Skip to content

Commit e788227

Browse files
author
thk123
committed
Tidy up convert method to remove unnecessary else statements
1 parent c2fba40 commit e788227

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2748,27 +2748,28 @@ bool java_bytecode_convert_methodt::is_method_inherited(
27482748
{
27492749
return true;
27502750
}
2751+
27512752
// methods with the default access modifier are only
27522753
// accessible within the same package.
2753-
2754-
else if(access==ID_default)
2754+
if(access==ID_default)
27552755
{
27562756
const std::string &class_package=
27572757
java_class_to_package(id2string(classname));
27582758
const std::string &method_package=
27592759
java_class_to_package(id2string(resolved_call.get_class_identifier()));
27602760
return method_package==class_package;
27612761
}
2762-
else if(access==ID_private)
2762+
2763+
if(access==ID_private)
27632764
{
27642765
// This is somewhat contentious: previously this code would keep walking
27652766
// up the parent if it found a private function. But this isn't what Java
27662767
// appears to do. If a private method is found then that becomes the
27672768
// virtual signuate and blocks access to the parent class
27682769
return false;
27692770
}
2770-
else
2771-
INVARIANT(false, "Unexpected access modifier.");
2771+
2772+
INVARIANT(false, "Unexpected access modifier.");
27722773
}
27732774

27742775
return false;

0 commit comments

Comments
 (0)