"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/test/groovy/bugs/Groovy8048Bug.groovy" between
apache-groovy-src-3.0.8.zip and apache-groovy-src-3.0.9.zip

About: Groovy is an agile dynamic (scripting) language for the Java Platform. It has features similar to those of Python, Ruby, Perl, and Smalltalk. Source release.

Groovy8048Bug.groovy  (apache-groovy-src-3.0.8):Groovy8048Bug.groovy  (apache-groovy-src-3.0.9)
skipping to change at line 21 skipping to change at line 21
* *
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package groovy.bugs package groovy.bugs
import groovy.test.GroovyTestCase import org.junit.Test
class Groovy8048Bug extends GroovyTestCase { import static groovy.test.GroovyAssert.assertScript
final class Groovy8048 {
@Test
void testFinalFieldInPreCompiledTrait() { void testFinalFieldInPreCompiledTrait() {
def shell = new GroovyShell(getClass().classLoader) assertScript """
shell.evaluate(''' class C implements ${getClass().getName()}.Foo, Bar {
class Bar implements groovy.bugs.Groovy8048Bug.Groovy8048Trait, BarT
rait {
static void main(args) { static void main(args) {
assert Bar.otherItems1 && Bar.otherItems1[0] == 'bar1' assert this.otherItems1 && this.otherItems1[0] == 'bar1'
assert Bar.items1 && Bar.items1[0] == 'foo1' assert this.items1 && this.items1[0] == 'foo1'
new Bar().with { new C().with {
assert otherItems2 && otherItems2[0] == 'bar2' assert otherItems2 && otherItems2[0] == 'bar2'
assert items2 && items2[0] == 'foo2' assert items2 && items2[0] == 'foo2'
} }
} }
trait BarTrait {
final static List otherItems1 = ['bar1']
final List otherItems2 = ['bar2']
}
} }
''', 'testScript')
trait Bar {
final static List otherItems1 = ['bar1']
final List otherItems2 = ['bar2']
}
"""
} }
trait Groovy8048Trait { trait Foo {
final static List items1 = ['foo1'] final static List items1 = ['foo1']
final List items2 = ['foo2'] final List items2 = ['foo2']
} }
} }
 End of changes. 7 change blocks. 
15 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)