Skip to content

Conversation

alex-on-java
Copy link
Contributor

Remove some code duplicates by extracting method convertValues(Object[] values) in Update.java and replace manual coping of array by System.arraycopy()

@thomasdarimont
Copy link

Good catch!

Perhaps it would be even better to use Arrays.copyOf which is available since Java 6 instead of copying the Object[] yourself: https://github.com/spring-projects/spring-data-mongodb/pull/255/files#diff-4ed60eae836aaab5fdd6439683099d75R431

Object[] arr = { 1, 2, 3, 4 };
Object[] copy = Arrays.copyOf(arr, arr.length);

@alex-on-java
Copy link
Contributor Author

Thomas, you are right!
Made new commit

@alex-on-java alex-on-java force-pushed the alex_Update_convertedValues branch from abb1993 to 5a958d0 Compare December 18, 2014 09:33
…nvertedValues

Conflicts:
	spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/BasicUpdate.java
	spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Update.java
@alex-on-java
Copy link
Contributor Author

Couldn't rebase properly, so I made another pull request: #258

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