X Tutup
Skip to content

Commit db48fa3

Browse files
committed
Merge remote-tracking branch 'origin/master' into nh-async-query
Conflicts: changelog.txt realm-jni/src/io_realm_internal_SharedGroup.cpp realm/src/main/java/io/realm/RealmObject.java realm/src/main/java/io/realm/internal/SharedGroup.java
2 parents 4677d57 + 0b97009 commit db48fa3

File tree

56 files changed

+2873
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2873
-214
lines changed

.idea/codeStyleSettings.xml

Lines changed: 218 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ If you want to test recent bugfixes or features that have not been packaged in a
3838
}
3939

4040
dependencies {
41-
compile 'io.realm:realm-android:0.81.2-SNAPSHOT'
41+
compile 'io.realm:realm-android:0.82.0-SNAPSHOT'
4242
}
4343

4444
## Building Realm

changelog.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
0.82
2-
* Support async queries
2+
* Support async queries & transaction
3+
* Trying to access a deleted Realm object throw throws a proper IllegalStateException.
4+
* Added in-memory Realm support.
5+
* Closing realm on another thread different from where it was created now throws an exception.
6+
* @Index annotation can also be applied to byte/short/int/long/boolean/Date
7+
now.
38

49
0.81.1
510
* Fixed memory leak causing Realm to never release Realm objects.
@@ -140,7 +145,7 @@
140145
* Bug fixed in Exception text when field names was not matching the database
141146
* Bug fixed so Realm no longer throws an Exception when removing the last object
142147
* Bug fixed in RealmResults which prevented sub-querying
143-
* The Date type does not support millisecond resolution, and dates before 1900-12-13
148+
* The Date type does not support millisecond resolution, and dates before 1901-12-13
144149
and dates after 2038-01-19 are not supported on 32 bit systems
145150
* Fixed bug so Realm no longer throws an Exception when removing the last object
146151
* Bug fixed in RealmResults which prevented subquerying

examples/introExample/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ tasks.preBuild {
3232
}
3333

3434
dependencies {
35-
compile files("../../realm/build/libs/realm-${version}.jar")
35+
// compile files("../../realm/build/libs/realm-${version}.jar")
36+
compile 'io.realm:realm-android:0.81.1'
3637
}

examples/introExample/src/main/AndroidManifest.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
<intent-filter>
1414
<action android:name="android.intent.action.MAIN" />
1515

16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
<activity
20+
android:name=".MainActivity"
21+
android:label="@string/title_activity_main" >
22+
<intent-filter>
23+
<action android:name="android.intent.action.MAIN" />
24+
1625
<category android:name="android.intent.category.LAUNCHER" />
1726
</intent-filter>
1827
</activity>

examples/introExample/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
<string name="app_name">Intro example</string>
55
<string name="hello_world">Hello world!</string>
66
<string name="action_settings">Settings</string>
7+
<string name="title_activity_main">MainActivity</string>
78

89
</resources>

examples/threadExample/src/main/java/io/realm/examples/threads/MyApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ public void onCreate() {
3131
RealmConfiguration realmConfiguration = new RealmConfiguration.Builder(this).build();
3232
Realm.deleteRealm(realmConfiguration); // Clean slate
3333
Realm.setDefaultConfiguration(realmConfiguration); // Make this Realm the default
34+
3435
}
3536
}

gradle-plugin/plugin/src/main/groovy/io/realm/gradle/Realm.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ class Realm implements Plugin<Project> {
88
@Override
99
void apply(Project project) {
1010
project.repositories.add(project.repositories.jcenter())
11-
project.dependencies.add('compile', 'io.realm:realm-android:0.80.3') // TODO: make version dynamic
11+
project.dependencies.add('compile', 'io.realm:realm-android:0.81.1') // TODO: make version dynamic
1212
}
1313
}

realm-annotations-processor/src/main/java/io/realm/processor/ClassMetaData.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.Map;
2525
import java.util.Set;
2626

27-
import javax.annotation.processing.Messager;
2827
import javax.annotation.processing.ProcessingEnvironment;
2928
import javax.lang.model.element.Element;
3029
import javax.lang.model.element.ElementKind;
@@ -294,13 +293,17 @@ private boolean categorizeClassElements() {
294293
}
295294

296295
if (variableElement.getAnnotation(Index.class) != null) {
297-
// The field has the @Index annotation. It's only valid for:
298-
// * String
296+
// The field has the @Index annotation. It's only valid for column types:
297+
// STRING, DATE, INTEGER, BOOLEAN
299298
String elementTypeCanonicalName = variableElement.asType().toString();
300-
if (elementTypeCanonicalName.equals("java.lang.String")) {
299+
String columnType = Constants.JAVA_TO_COLUMN_TYPES.get(elementTypeCanonicalName);
300+
if (columnType != null && (columnType.equals("ColumnType.STRING") ||
301+
columnType.equals("ColumnType.DATE") ||
302+
columnType.equals("ColumnType.INTEGER") ||
303+
columnType.equals("ColumnType.BOOLEAN"))) {
301304
indexedFields.add(variableElement);
302305
} else {
303-
Utils.error("@Index is only applicable to String fields - got " + element);
306+
Utils.error("@Index is not applicable to this field " + element + ".");
304307
return false;
305308
}
306309
}
@@ -367,7 +370,11 @@ public String getSimpleClassName() {
367370
* model classes.
368371
*/
369372
public boolean isModelClass() {
370-
return (!classType.toString().endsWith(".RealmObject") && !classType.toString().endsWith("RealmProxy"));
373+
String type = classType.toString();
374+
if (type.equals("io.realm.dynamic.DynamicRealmObject")) {
375+
return false;
376+
}
377+
return (!type.endsWith(".RealmObject") && !type.endsWith("RealmProxy"));
371378
}
372379

373380
public String getFullyQualifiedClassName() {

0 commit comments

Comments
 (0)
X Tutup