Skip to content

Commit 5f36be5

Browse files
committed
Merge branch 'development' of github.com:foodtiny/native into development
2 parents 7c17b29 + 0b57922 commit 5f36be5

6 files changed

Lines changed: 21 additions & 19 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ More examples can be found [here](https://github.com/foodtiny/native/tree/master
8787

8888
### Contributors
8989
- This library must be followed [Oracle Java 8 Documentation](https://docs.oracle.com/javase/8/docs/api) for standardization
90-
- Make sure your commits must be passed before you create pull request
90+
- Make sure your commits must be passed with [check](./check) before you create pull request
9191
- At least one contributor in this project reviews your commits (except you) before merging
9292
- Best practices guidelines in [CONTRIBUTION.md](https://github.com/foodtiny/native/tree/master/CONTRIBUTION.md)
9393

java/util/HashMap/HashMap.hpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,12 @@ namespace Java {
106106

107107
public:
108108
/**
109-
* Compares the specified object
109+
* Compares the anotherHashMap
110110
* with this map for equality.
111111
*
112-
* @param object
112+
* @param anotherHashMap
113+
* @return true if equal
114+
* false if not equal
113115
*/
114116
boolean equals(const HashMap<Key, Value> &anotherHashMap) {
115117

@@ -133,13 +135,13 @@ namespace Java {
133135
*
134136
* @param action
135137
*/
136-
void forEach(BiConsumer<void(Key, Value)> action) {
137-
for (auto &element : this->original) {
138-
Key key = element.first;
139-
Value value = element.second;
140-
action(key, value);
141-
}
142-
}
138+
// void forEach(BiConsumer<void(Key, Value)> action) {
139+
// for (auto &element : this->original) {
140+
// Key key = element.first;
141+
// Value value = element.second;
142+
// action(key, value);
143+
// }
144+
// }
143145

144146
// TODO(thoangminh): We will support this method later
145147
/**
@@ -151,10 +153,10 @@ namespace Java {
151153
* Object.
152154
*
153155
* This implementation iterates over entrySet(), calling
154-
* {Map.Entry hashCode()} on each element (entry) in the
156+
* Map.Entry hashCode() on each element (entry) in the
155157
* set, and adding up the results.
156158
*
157-
* @return the hash code value for this map
159+
* @return int the hash code value for this map
158160
*/
159161
int hashCode();
160162

@@ -415,8 +417,7 @@ namespace Java {
415417
/**
416418
* Set of hash map entries
417419
*
418-
* Returns a Set view of the mappings contained in this map.
419-
* @return Set<Map.Entry<Key,Value>> - a set view of the mappings contained in this map
420+
* @return a set view of the mappings contained in this map
420421
*/
421422
Set<class Map<Key, Value>::Entry> entrySet() {
422423
Set<class Map<Key, Value>::Entry> entrySet;
@@ -431,12 +432,12 @@ namespace Java {
431432

432433
/**
433434
* Returns the value to which the specified key is mapped,
434-
* or null if this map contains no mapping for the key
435+
* or default if this map contains no mapping for the key
435436
*
436437
* @param key the key whose associated value is to be returned
437438
*
438439
* @return Value value the value to which the specified key is mapped,
439-
* or null if no mapping with key
440+
* or default if no mapping with key
440441
*/
441442
Value get(const Key &key) const {
442443
Value result;

java/util/HashMap/HashMapTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ TEST (JavaUtil, HashMapContainsValue) {
147147
TEST (JavaUtil, HashMapEntrySet) {
148148
HashMap<String, String> hashMap;
149149

150-
for (int index = 1; index <= 100; index++) {
150+
int index = 1;
151+
152+
for (index; index <= 100; index++) {
151153
hashMap.put("Key " + String::valueOf(index),
152154
"Value " + String::valueOf(index));
153155
}

kernel/Test.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ void assertEqualsString(String expected,
696696
const_string file,
697697
int line) {
698698
if (expected != actual) {
699-
CTEST_ERR("%s:%d\nEXPECTED\n'%'\nACTUAL \n'%s'\n",
699+
CTEST_ERR("%s:%d\nEXPECTED\n'%s'\nACTUAL \n'%s'\n",
700700
file, line, expected.toString(), actual.toString());
701701
}
702702
}

kernel/Type.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
#define NOT_FOUND -1
3131
#define MAX_STRING_LENGTH 100000
32-
#define BiConsumer std::function
3332

3433
#ifdef WIN
3534
#define boolean bool

native_test.exe

-11.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)