Skip to content
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

#220 do *not* use Arrays.copyOf(), performance seems to be inferior #224

Open
wants to merge 3 commits 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
1 change: 0 additions & 1 deletion src/main/java/com/ctc/wstx/sr/AttributeCollector.java
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,6 @@ public ElemAttrs buildAttrOb()
*/
int amapLen = mAttrMap.length;
int[] amap = new int[amapLen];
// TODO: JDK 1.6 has Arrays.copyOf(), should use with Woodstox 6
System.arraycopy(mAttrMap, 0, amap, 0, amapLen);
return new ElemAttrs(raw, mNonDefCount,
amap, mAttrHashSize, mAttrSpillEnd);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ctc/wstx/sr/TypedStreamReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public final int readElementAsArray(TypedArrayDecoder dec)
while (true) {
type = next();
if (type == END_ELEMENT) {
// Simple... no textul content
// Simple... no textual content
return -1;
}
if (type == COMMENT || type == PROCESSING_INSTRUCTION) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ctc/wstx/util/StringVector.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ctc.wstx.util;

/**
* Data container similar {@link java.util.List} (from storage perspective),
* Data container similar to {@link java.util.List} (from storage perspective),
* but that can be used in multiple ways. For some uses it acts more like
* type-safe String list/vector; for others as order associative list of
* String-to-String mappings.
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/stax2/stream/TestReaderConstruction.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ public void testCreateWithByteArraySource()
byte[] b = orig.clone();
verifyXML(ifact.createXMLStreamReader(new Stax2ByteArraySource(b, 0, b.length)), "ByteArraySource");

// Also: let's check that non-0 offset works...
final int OFFSET = 29;
final int DOCLEN = b.length;
byte[] b2 = new byte[OFFSET + DOCLEN + 50];
System.arraycopy(b, 0, b2, OFFSET, DOCLEN);
// Also: let's check that non-0 offset works...
final int OFFSET = 29;
final int DOCLEN = b.length;
byte[] b2 = new byte[OFFSET + DOCLEN + 50];
System.arraycopy(b, 0, b2, OFFSET, DOCLEN);
verifyXML(ifact.createXMLStreamReader(new Stax2ByteArraySource(b2, OFFSET, DOCLEN)), "ByteArraySource");
}

Expand Down