Skip to content

Java.Util.HashMap#257

Merged
tiny-express merged 3 commits intodevelopmentfrom
java.util.HashMap
Oct 20, 2017
Merged

Java.Util.HashMap#257
tiny-express merged 3 commits intodevelopmentfrom
java.util.HashMap

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Sep 18, 2017

Edited + checked old source.
Built + Add test for new method.

@ghost ghost requested review from TuanAnhNguyen69, dthongvl and loint September 18, 2017 13:28
@ghost ghost self-assigned this Sep 18, 2017
@dthongvl dthongvl changed the title Java.util.Hash map Java.util.HashMap Sep 18, 2017
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 18, 2017

Codecov Report

Merging #257 into development will decrease coverage by 1.26%.
The diff coverage is 100%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #257      +/-   ##
===============================================
- Coverage        95.62%   94.35%   -1.27%     
===============================================
  Files              186      173      -13     
  Lines            16565    15443    -1122     
  Branches           270      267       -3     
===============================================
- Hits             15840    14571    -1269     
- Misses             725      872     +147
Impacted Files Coverage Δ
java/util/HashMap/HashMap.hpp 99.2% <ø> (ø) ⬆️
kernel/Test.hpp 52.71% <ø> (-1.31%) ⬇️
java/util/HashMap/HashMapTest.cpp 100% <100%> (ø) ⬆️
java/util/Date/Date.cpp 0% <0%> (-100%) ⬇️
java/lang/String/String.hpp 96.85% <0%> (-0.05%) ⬇️
java/util/ArrayList/ArrayListTest.cpp 100% <0%> (ø) ⬆️
java/lang/Object/Object.hpp 96.87% <0%> (ø) ⬆️
java/lang/String/StringTest.cpp 100% <0%> (ø) ⬆️
java/security/MessageDigest/MessageDigestTest.cpp
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21a3ecb...5109168. Read the comment docs.

@ghost ghost added reviewing and removed pull request labels Sep 19, 2017
@loint loint changed the title Java.util.HashMap Java.Util.HashMap Sep 19, 2017
@ghost ghost added the fixed label Sep 22, 2017
Copy link
Copy Markdown
Contributor

@TuanAnhNguyen69 TuanAnhNguyen69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check for some mistakes in comments

result = anotherMap.get(notExpectedKey);
hashMap.put("Key1", "Value of Key1");
hashMap.put("Key2", "Value of Key2");
HashMap<String, String> anotherMap = (HashMap<String, String>) hashMap.clone();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this cast, is't not necessary

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.


TEST (JavaUtil, HashMapReplaceSpecifiedValue) {
// Given valid hash map to test
TEST(JavaUtil, HashMapReplace2) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename this test

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

kernel/type.h Outdated
#define FALSE 0
#define NOT_FOUND -1
#define MAX_STRING_LENGTH 100000
#define BiConsumer std::function
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should comment this and wait for BiConsumer class

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this definition because it's wrong. Should be BiConsumer implementation

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

*
* @param action
*/
void forEach (BiConsumer<void(Key, Value)> action) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should comment this and wait for BiConsumer class

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

*
* @return a set view of the keys contained in this map
*/
// Set<Key> keySet() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set class is available, what do you really need in Set class?

@TuanAnhNguyen69 TuanAnhNguyen69 self-assigned this Sep 23, 2017
Copy link
Copy Markdown
Collaborator

@loint loint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all binaries in your PR.

kernel/type.h Outdated
#define FALSE 0
#define NOT_FOUND -1
#define MAX_STRING_LENGTH 100000
#define BiConsumer std::function
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this definition because it's wrong. Should be BiConsumer implementation

Copy link
Copy Markdown
Contributor

@dthongvl dthongvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unused files and ignore them.
Please update methods' s comment that use null

kernel/Type.hpp Outdated

#define NOT_FOUND -1
#define MAX_STRING_LENGTH 100000
#define BiConsumer std::function
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

* Compares the specified object
* with this map for equality.
*
* @param object
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update param

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

*
* @param action
*/
void forEach(BiConsumer<void(Key, Value)> action) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please help me disable this function until BiConsumer is implemented

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

* {Map.Entry hashCode()} on each element (entry) in the
* set, and adding up the results.
*
* @return the hash code value for this map
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

* Object.
*
* This implementation iterates over entrySet(), calling
* {Map.Entry hashCode()} on each element (entry) in the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove { }

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

* Set of hash map entries
*
* Returns a Set view of the mappings contained in this map.
* @return Set<Map.Entry<Key,Value>> - a set view of the mappings contained in this map
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please help me update return data type.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.


/**
* Returns the value to which the specified key is mapped,
* or null if this map contains no mapping for the key
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default constructor or something, not null

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

assertEquals(100, counter);
HashMap<String, String> hashMap;

for (int index = 1; index <= 100; index++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create int index; outside the loop

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fixed.

@ghost ghost added the fixed label Oct 16, 2017
@ghost ghost removed the changes requested label Oct 16, 2017
@tiny-express
Copy link
Copy Markdown
Collaborator

This PR will be close because no progress.

@tiny-express tiny-express merged commit 4e74c7e into development Oct 20, 2017
@tiny-express tiny-express deleted the java.util.HashMap branch October 20, 2017 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

6 participants