Skip to content

Commit

Permalink
Java 17 Switch semantics changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wide4head authored and HannesWell committed Apr 30, 2023
1 parent 25e36e9 commit 716d206
Showing 1 changed file with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,14 @@ protected void processElement(String uri, String localName, String name, Attribu
String qName = attributes.getValue(IApiXmlConstants.ATTR_TYPE);
String memberName = attributes.getValue(IApiXmlConstants.ATTR_MEMBER_NAME);
String signature = attributes.getValue(IApiXmlConstants.ATTR_SIGNATURE);
IMemberDescriptor member = null;
switch (type) {
case IReference.T_TYPE_REFERENCE -> {
member = Factory.typeDescriptor(qName);
}
case IReference.T_METHOD_REFERENCE -> {
member = Factory.methodDescriptor(qName, memberName, signature);
}
case IReference.T_FIELD_REFERENCE -> {
member = Factory.fieldDescriptor(qName, memberName);
}
} enterTargetMember(member);
break;
IMemberDescriptor member = switch (type)
{
case IReference.T_TYPE_REFERENCE -> Factory.typeDescriptor(qName);
case IReference.T_METHOD_REFERENCE -> Factory.methodDescriptor(qName, memberName, signature);
case IReference.T_FIELD_REFERENCE -> Factory.fieldDescriptor(qName, memberName);
default -> null;
};
enterTargetMember(member);
}
case IApiXmlConstants.REFERENCE_KIND -> {
String value = attributes.getValue(IApiXmlConstants.ATTR_KIND);
Expand Down Expand Up @@ -201,7 +196,6 @@ protected void processElement(String uri, String localName, String name, Attribu
} else {
System.out.println(NLS.bind("Element {0} is missing type attribute and will be skipped", targetMember.getName())); //$NON-NLS-1$
}
break;
}
}
}
Expand Down

0 comments on commit 716d206

Please sign in to comment.