File: modifiers.bsh

package info (click to toggle)
bsh 2.0b4-15
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 4,212 kB
  • sloc: java: 23,430; xml: 4,500; sh: 139; makefile: 30
file content (44 lines) | stat: -rw-r--r-- 1,129 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/java bsh.Interpreter

source("TestHarness.bsh");

private int bar() { }
private bar() { }
private int bar() { }
private synchronized int bar() { }
private synchronized bar() { }
private synchronized final bar() { }
assert( isEvalError("private private int bar() { }") ); 
assert( isEvalError("private private bar() { }") ); 
assert( isEvalError("private public int bar() { }") ); 
assert( isEvalError("private public bar() { }") ); 
assert( isEvalError("volatile int bar() { }") ); 

int foo;
int foo2=5;
private int foo3;
private final int foo3;
private int foo4=5;
private int foo5;
private volatile int foo6;
private volatile int foo7 = 2;
assert( isEvalError("synchronized int bar20") ); 
assert( isEvalError("public private int bar21") ); 

final int fin = 1;
assert( isEvalError("fin=2") ); 

// static not allowed outside of class?
// perhaps we'll just ignore it
//assert( isEvalError("static int a") ); 
//assert( isEvalError("static int method() { }") ); 
static int a;
static int method() { };

// untyped can't have modifiers right now
//final qbert=2;
//private qbert;
//private final qbert2=5;

complete();