@@ -81,15 +81,18 @@ SCENARIO(
81
81
" InnerClassesDefault" , " ./java_bytecode/java_bytecode_parser" );
82
82
WHEN (" Parsing the InnerClasses attribute for a public inner class" )
83
83
{
84
- THEN (" The class should be marked as public" )
84
+ THEN (
85
+ " The inner class should be marked as package-private (default) because "
86
+ " its "
87
+ " containing class has stricter access " )
85
88
{
86
89
const symbolt &class_symbol = new_symbol_table.lookup_ref (
87
90
" java::InnerClassesDefault$PublicInnerClass" );
88
91
const java_class_typet java_class =
89
92
to_java_class_type (class_symbol.type );
90
93
REQUIRE_FALSE (java_class.get_is_anonymous_class ());
91
94
REQUIRE (java_class.get_is_inner_class ());
92
- REQUIRE (java_class.get_access () == ID_public );
95
+ REQUIRE (java_class.get_access () == ID_default );
93
96
}
94
97
}
95
98
WHEN (
@@ -109,15 +112,17 @@ SCENARIO(
109
112
}
110
113
WHEN (" Parsing the InnerClasses attribute for a protected inner class" )
111
114
{
112
- THEN (" The class should be marked as protected" )
115
+ THEN (
116
+ " The inner class should be marked as package-private (default) because "
117
+ " its containing class has stricter access " )
113
118
{
114
119
const symbolt &class_symbol = new_symbol_table.lookup_ref (
115
120
" java::InnerClassesDefault$ProtectedInnerClass" );
116
121
const java_class_typet java_class =
117
122
to_java_class_type (class_symbol.type );
118
123
REQUIRE_FALSE (java_class.get_is_anonymous_class ());
119
124
REQUIRE (java_class.get_is_inner_class ());
120
- REQUIRE (java_class.get_access () == ID_protected );
125
+ REQUIRE (java_class.get_access () == ID_default );
121
126
}
122
127
}
123
128
WHEN (" Parsing the InnerClasses attribute for a private inner class" )
@@ -145,7 +150,9 @@ SCENARIO(
145
150
" Parsing the InnerClasses attribute for a public doubly-nested inner "
146
151
" class" )
147
152
{
148
- THEN (" The class should be marked as public" )
153
+ THEN (
154
+ " The inner class should be marked as package-private (default) because "
155
+ " its containing class has stricter access " )
149
156
{
150
157
const symbolt &class_symbol = new_symbol_table.lookup_ref (
151
158
" java::InnerClassesDeeplyNested$SinglyNestedClass$"
@@ -154,7 +161,7 @@ SCENARIO(
154
161
to_java_class_type (class_symbol.type );
155
162
REQUIRE_FALSE (java_class.get_is_anonymous_class ());
156
163
REQUIRE (java_class.get_is_inner_class ());
157
- REQUIRE (java_class.get_access () == ID_public );
164
+ REQUIRE (java_class.get_access () == ID_default );
158
165
}
159
166
}
160
167
WHEN (
@@ -177,7 +184,9 @@ SCENARIO(
177
184
" Parsing the InnerClasses attribute for a package private (default) "
178
185
" doubly-nested inner class " )
179
186
{
180
- THEN (" The inner class should be marked as protected" )
187
+ THEN (
188
+ " The inner class should be marked as package-private (default) because "
189
+ " its containing class has stricter access " )
181
190
{
182
191
const symbolt &class_symbol = new_symbol_table.lookup_ref (
183
192
" java::InnerClassesDeeplyNested$SinglyNestedClass$"
@@ -186,7 +195,7 @@ SCENARIO(
186
195
to_java_class_type (class_symbol.type );
187
196
REQUIRE_FALSE (java_class.get_is_anonymous_class ());
188
197
REQUIRE (java_class.get_is_inner_class ());
189
- REQUIRE (java_class.get_access () == ID_protected );
198
+ REQUIRE (java_class.get_access () == ID_default );
190
199
}
191
200
}
192
201
WHEN (
0 commit comments