src/share/classes/com/sun/jndi/dns/ResourceRecords.java
Print this page
@@ -43,14 +43,14 @@
class ResourceRecords {
// Four sections: question, answer, authority, additional.
// The question section is treated as being made up of (shortened)
// resource records, although this isn't technically how it's defined.
- Vector question = new Vector();
- Vector answer = new Vector();
- Vector authority = new Vector();
- Vector additional = new Vector();
+ Vector<ResourceRecord> question = new Vector<>();
+ Vector<ResourceRecord> answer = new Vector<>();
+ Vector<ResourceRecord> authority = new Vector<>();
+ Vector<ResourceRecord> additional = new Vector<>();
/*
* True if these resource records are from a zone transfer. In
* that case only answer records are read (as per
* draft-ietf-dnsext-axfr-clarify-02.txt). Also, the rdata of
@@ -78,22 +78,22 @@
*/
int getFirstAnsType() {
if (answer.size() == 0) {
return -1;
}
- return ((ResourceRecord) answer.firstElement()).getType();
+ return answer.firstElement().getType();
}
/*
* Returns the type field of the last answer record, or -1 if
* there are no answer records.
*/
int getLastAnsType() {
if (answer.size() == 0) {
return -1;
}
- return ((ResourceRecord) answer.lastElement()).getType();
+ return answer.lastElement().getType();
}
/*
* Decodes the resource records in a DNS message and adds
* them to this object.