Skip to content

Commit

Permalink
Fix derp-check in MemberInfo which was using nonsense logic - fixes #242
Browse files Browse the repository at this point in the history
  • Loading branch information
Mumfrey committed Mar 20, 2018
1 parent aece829 commit 086a706
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,12 @@ public MemberInfo validate() throws InvalidMemberDescriptorException {
if (!this.owner.matches("(?i)^[\\w\\p{Sc}/]+$")) {
throw new InvalidMemberDescriptorException("Invalid owner: " + this.owner);
}
try {
if (!this.owner.equals(Type.getType(this.owner).getDescriptor())) {
throw new InvalidMemberDescriptorException("Invalid owner type specified: " + this.owner);
}
} catch (Exception ex) {
throw new InvalidMemberDescriptorException("Invalid owner type specified: " + this.owner);
// We can't detect this situation 100% reliably, but we can take a
// decent stab at it in order to detect really obvious cases where
// the user types a dot instead of a semicolon
if (this.unparsed != null && this.unparsed.lastIndexOf('.') > 0 && this.owner.startsWith("L")) {
throw new InvalidMemberDescriptorException("Malformed owner: " + this.owner + " If you are seeing this message unexpectedly and the"
+ " owner appears to be correct, replace the owner descriptor with formal type L" + this.owner + "; to suppress this error");
}
}

Expand Down

0 comments on commit 086a706

Please sign in to comment.