Skip to content

removing redundant casts #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ public String getNamespacePrefix(int index) {
handleIllegalNsIndex(index);
}
// Note: _nsDeclList entries have been appropriately intern()ed if need be
return (String) _nsDeclList.get(index + index);
return _nsDeclList.get(index + index);
}

@Override
Expand All @@ -683,7 +683,7 @@ public String getNamespaceURI(int index) {
handleIllegalNsIndex(index);
}
// Note: _nsDeclList entries have been appropriately intern()ed if need be
return (String) _nsDeclList.get(index + index + 1);
return _nsDeclList.get(index + index + 1);
}

// Note: implemented as part of NamespaceContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public EndElementEventImpl(Location loc, QName name, Iterator<Namespace> namespa
* not strictly required, but helps in preventing later
* problems
*/
l.add((Namespace) namespaces.next());
l.add(namespaces.next());
}
mNamespaces = l;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ public void writeAsEncodedUnicode(Writer w)
if (_nsDecls != null) {
for (int i = 0, len = _nsDecls.size(); i < len; ++i) {
w.write(' ');
((Namespace) _nsDecls.get(i)).writeAsEncodedUnicode(w);
_nsDecls.get(i).writeAsEncodedUnicode(w);
}
}

// How about attrs?
if (_attrs != null) {
for (int i = 0, len = _attrs.size(); i < len; ++i) {
Attribute attr = (Attribute) _attrs.get(i);
Attribute attr = _attrs.get(i);
// No point in adding default attributes?
if (attr.isSpecified()) {
w.write(' ');
Expand All @@ -156,7 +156,7 @@ public void writeUsing(XMLStreamWriter2 sw) throws XMLStreamException
// Any namespaces?
if (_nsDecls != null) {
for (int i = 0, len = _nsDecls.size(); i < len; ++i) {
Namespace ns = (Namespace) _nsDecls.get(i);
Namespace ns = _nsDecls.get(i);
String prefix = ns.getPrefix();
String uri = ns.getNamespaceURI();
if (prefix == null || prefix.length() == 0) {
Expand All @@ -170,7 +170,7 @@ public void writeUsing(XMLStreamWriter2 sw) throws XMLStreamException
// How about attrs?
if (_attrs != null) {
for (int i = 0, len = _attrs.size(); i < len; ++i) {
Attribute attr = (Attribute) _attrs.get(i);
Attribute attr = _attrs.get(i);
// No point in adding default attributes?
if (attr.isSpecified()) {
QName name = attr.getName();
Expand Down Expand Up @@ -221,7 +221,7 @@ public String getNamespaceURI(String prefix)
prefix = "";
}
for (int i = 0, len = _nsDecls.size(); i < len; ++i) {
Namespace ns = (Namespace) _nsDecls.get(i);
Namespace ns = _nsDecls.get(i);
String thisPrefix = ns.getPrefix();
if (thisPrefix == null) {
thisPrefix = "";
Expand All @@ -248,7 +248,7 @@ public Attribute getAttributeByName(QName nameIn)

boolean notInNs = (uri == null || uri.length() == 0);
for (int i = 0; i < len; ++i) {
Attribute attr = (Attribute) _attrs.get(i);
Attribute attr = _attrs.get(i);
QName name = attr.getName();
if (name.getLocalPart().equals(ln)) {
String thisUri = name.getNamespaceURI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public int decode(byte[] resultBuffer, int resultOffset, int maxLength)
private boolean nextSegment()
{
if (_nextSegmentIndex < _nextSegments.size()) {
_currSegment = (char[]) _nextSegments.get(_nextSegmentIndex++);
_currSegment = _nextSegments.get(_nextSegmentIndex++);
// last segment may have non-zero ptr, slack at end
if (_nextSegmentIndex == _nextSegments.size()) {
_currSegmentPtr = _lastSegmentOffset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static XMLValidationSchemaFactory newInstance(String schemaType, ClassLoa
throws FactoryConfigurationError
{
// Let's check and map schema type to the shorter internal id:
String internalId = (String) sSchemaIds.get(schemaType);
String internalId = sSchemaIds.get(schemaType);
if (internalId == null) {
throw new FactoryConfigurationError("Unrecognized schema type (id '"+schemaType+"')");
}
Expand Down