Skip to content

Commit b7eb409

Browse files
authored
Merge pull request #27 from hduelme/removing-redundant-casts
removing redundant casts
2 parents 7771fcf + 1a3b429 commit b7eb409

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/main/java/org/codehaus/stax2/ri/dom/DOMWrappingReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ public String getNamespacePrefix(int index) {
657657
handleIllegalNsIndex(index);
658658
}
659659
// Note: _nsDeclList entries have been appropriately intern()ed if need be
660-
return (String) _nsDeclList.get(index + index);
660+
return _nsDeclList.get(index + index);
661661
}
662662

663663
@Override
@@ -683,7 +683,7 @@ public String getNamespaceURI(int index) {
683683
handleIllegalNsIndex(index);
684684
}
685685
// Note: _nsDeclList entries have been appropriately intern()ed if need be
686-
return (String) _nsDeclList.get(index + index + 1);
686+
return _nsDeclList.get(index + index + 1);
687687
}
688688

689689
// Note: implemented as part of NamespaceContext

src/main/java/org/codehaus/stax2/ri/evt/EndElementEventImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public EndElementEventImpl(Location loc, QName name, Iterator<Namespace> namespa
6161
* not strictly required, but helps in preventing later
6262
* problems
6363
*/
64-
l.add((Namespace) namespaces.next());
64+
l.add(namespaces.next());
6565
}
6666
mNamespaces = l;
6767
}

src/main/java/org/codehaus/stax2/ri/evt/StartElementEventImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ public void writeAsEncodedUnicode(Writer w)
124124
if (_nsDecls != null) {
125125
for (int i = 0, len = _nsDecls.size(); i < len; ++i) {
126126
w.write(' ');
127-
((Namespace) _nsDecls.get(i)).writeAsEncodedUnicode(w);
127+
_nsDecls.get(i).writeAsEncodedUnicode(w);
128128
}
129129
}
130130

131131
// How about attrs?
132132
if (_attrs != null) {
133133
for (int i = 0, len = _attrs.size(); i < len; ++i) {
134-
Attribute attr = (Attribute) _attrs.get(i);
134+
Attribute attr = _attrs.get(i);
135135
// No point in adding default attributes?
136136
if (attr.isSpecified()) {
137137
w.write(' ');
@@ -156,7 +156,7 @@ public void writeUsing(XMLStreamWriter2 sw) throws XMLStreamException
156156
// Any namespaces?
157157
if (_nsDecls != null) {
158158
for (int i = 0, len = _nsDecls.size(); i < len; ++i) {
159-
Namespace ns = (Namespace) _nsDecls.get(i);
159+
Namespace ns = _nsDecls.get(i);
160160
String prefix = ns.getPrefix();
161161
String uri = ns.getNamespaceURI();
162162
if (prefix == null || prefix.length() == 0) {
@@ -170,7 +170,7 @@ public void writeUsing(XMLStreamWriter2 sw) throws XMLStreamException
170170
// How about attrs?
171171
if (_attrs != null) {
172172
for (int i = 0, len = _attrs.size(); i < len; ++i) {
173-
Attribute attr = (Attribute) _attrs.get(i);
173+
Attribute attr = _attrs.get(i);
174174
// No point in adding default attributes?
175175
if (attr.isSpecified()) {
176176
QName name = attr.getName();
@@ -221,7 +221,7 @@ public String getNamespaceURI(String prefix)
221221
prefix = "";
222222
}
223223
for (int i = 0, len = _nsDecls.size(); i < len; ++i) {
224-
Namespace ns = (Namespace) _nsDecls.get(i);
224+
Namespace ns = _nsDecls.get(i);
225225
String thisPrefix = ns.getPrefix();
226226
if (thisPrefix == null) {
227227
thisPrefix = "";
@@ -248,7 +248,7 @@ public Attribute getAttributeByName(QName nameIn)
248248

249249
boolean notInNs = (uri == null || uri.length() == 0);
250250
for (int i = 0; i < len; ++i) {
251-
Attribute attr = (Attribute) _attrs.get(i);
251+
Attribute attr = _attrs.get(i);
252252
QName name = attr.getName();
253253
if (name.getLocalPart().equals(ln)) {
254254
String thisUri = name.getNamespaceURI();

src/main/java/org/codehaus/stax2/ri/typed/CharArrayBase64Decoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public int decode(byte[] resultBuffer, int resultOffset, int maxLength)
256256
private boolean nextSegment()
257257
{
258258
if (_nextSegmentIndex < _nextSegments.size()) {
259-
_currSegment = (char[]) _nextSegments.get(_nextSegmentIndex++);
259+
_currSegment = _nextSegments.get(_nextSegmentIndex++);
260260
// last segment may have non-zero ptr, slack at end
261261
if (_nextSegmentIndex == _nextSegments.size()) {
262262
_currSegmentPtr = _lastSegmentOffset;

src/main/java/org/codehaus/stax2/validation/XMLValidationSchemaFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public static XMLValidationSchemaFactory newInstance(String schemaType, ClassLoa
121121
throws FactoryConfigurationError
122122
{
123123
// Let's check and map schema type to the shorter internal id:
124-
String internalId = (String) sSchemaIds.get(schemaType);
124+
String internalId = sSchemaIds.get(schemaType);
125125
if (internalId == null) {
126126
throw new FactoryConfigurationError("Unrecognized schema type (id '"+schemaType+"')");
127127
}

0 commit comments

Comments
 (0)