Skip to content

Conversation

@oxc
Copy link
Contributor

@oxc oxc commented Sep 29, 2015

The result objects returned by the proxy don't need to be synchronized.
However, the Vector class is fully synchronized for backwards compatibility (it's around since Java 2). This change uses the more lightweight ArrayList, initialized with the approximate target size, and the Collections.emptyList() singleton where applicable.

Since the project uses Java 7 anyway, I used diamond notation where possible.

The result objects returned by the proxy don't need to be synchronized.
However, the Vector class is fully synchronized for backwards 
compatibility (it's around since Java 2). This change uses the more
lightweight ArrayList, and the Collections.emptyList() singleton where
applicable.
@oxc
Copy link
Contributor Author

oxc commented Sep 29, 2015

Obviously, feel free to decline this change if you don't find it appropriate.

@dka23
Copy link
Owner

dka23 commented Sep 29, 2015

Seems to be cleaner and more modern, thanks!

dka23 added a commit that referenced this pull request Sep 29, 2015
Use un-synchronized Collections instead of Java2 Vector
@dka23 dka23 merged commit 09e56b7 into dka23:master Sep 29, 2015
@oxc oxc deleted the modern_collections branch September 29, 2015 14:51
@dka23 dka23 added this to the 1.0.0 milestone Sep 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants