Sfoglia il codice sorgente

Test for Bugzilla Bug 59397

   NPE in compiler when using (an unusual) declare warning against a ctor ITD
tags/Root_ajdt_support
aclement 20 anni fa
parent
commit
591e8fd6d2
2 ha cambiato i file con 24 aggiunte e 0 eliminazioni
  1. 8
    0
      tests/ajcTests.xml
  2. 16
    0
      tests/bugs/DecwInitializationITD.java

+ 8
- 0
tests/ajcTests.xml Vedi File

@@ -7666,4 +7666,12 @@
</compile>
</ajc-test>
<ajc-test dir="bugs"
pr="59397"
title="NPE in compiler when using (an unusual) declare warning against a ctor ITD">
<compile files="DecwInitializationITD.java">
<message kind="warning" line="16"/>
</compile>
</ajc-test>
</suite>

+ 16
- 0
tests/bugs/DecwInitializationITD.java Vedi File

@@ -0,0 +1,16 @@

// The actual ctor that gets put in type 'HW' during compilation is
// HW(String,A)
// This is an artifact of the implementation of ctor ITDing - unfortunately this artifact
// can be seen by the declare warning. So,
// initialization(HW.new(..)) will match our new ctor
// initialization(HW.new(String,A)) will match our new ctor
// initialization(HW.new(String)) will not match !

aspect A {
HW.new(String s) {}
declare warning : initialization(HW.new(String,A)) : "Funky ctor found!";
}


class HW {}

Loading…
Annulla
Salva