Skip to content

Commit 274229d

Browse files
Merge pull request #43 from contentstack/next
Next : Null issue identified in v3.12.3
2 parents 02e5559 + fbf9da3 commit 274229d

File tree

14 files changed

+59
-87
lines changed

14 files changed

+59
-87
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# CHANGELOG
22

3+
4+
## Version 3.12.4
5+
6+
### Date: 10-Oct-2023
7+
8+
- Fixed Context Issue introduced in v3.12.3
9+
10+
---
11+
312
## Version 3.12.0
413

514
### Date: 02-May-2023

contentstack/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ android {
1616
signingConfig signingConfigs.debug
1717
}
1818
buildTypes {
19-
//def localProperties = new Properties()
20-
//localProperties.load(new FileInputStream(rootProject.file("local.properties")))
19+
def localProperties = new Properties()
20+
localProperties.load(new FileInputStream(rootProject.file("local.properties")))
2121
}
2222
compileOptions {
23-
sourceCompatibility JavaVersion.VERSION_11
24-
targetCompatibility JavaVersion.VERSION_11
23+
sourceCompatibility JavaVersion.VERSION_1_8
24+
targetCompatibility JavaVersion.VERSION_1_8
2525
}
2626

2727
testOptions {
@@ -44,6 +44,6 @@ dependencies {
4444
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
4545
}
4646
java {
47-
sourceCompatibility = JavaVersion.VERSION_11
48-
targetCompatibility = JavaVersion.VERSION_11
47+
sourceCompatibility = JavaVersion.VERSION_1_8
48+
targetCompatibility = JavaVersion.VERSION_1_8
4949
}

contentstack/src/androidTest/java/com/contentstack/sdk/AssetTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void onCompletion(ResponseType responseType, Error error) {
8080
assertEquals("phoenix2.jpg", asset.getFileName());
8181
assertEquals("482141", asset.getFileSize());
8282
} else {
83-
assertEquals(0, error.getErrorCode());
83+
assertEquals(105, error.getErrorCode());
8484
}
8585
}
8686
});

contentstack/src/androidTest/java/com/contentstack/sdk/QueryTestCase.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public static void oneTimeSetUp() throws Exception {
3838
}
3939

4040

41-
4241
@Test
4342
public void test_01_fetchAllEntries() {
4443
query.find(new QueryResultsCallBack() {
@@ -615,7 +614,6 @@ public void onCompletion(ResponseType responseType, QueryResult queryresult, Err
615614

616615
@Test
617616
public void test_41_entry_include_embedded_items_unit_test() throws Exception {
618-
619617
final Query query = TestCred.stack().contentType("user").query();
620618
query.includeEmbeddedItems().find(new QueryResultsCallBack() {
621619
@Override

contentstack/src/azure-eu/java/AzureEUTest.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

contentstack/src/azure-na/java/AzureNATest.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

contentstack/src/eu/java/EUInstrumentedTest.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

contentstack/src/main/java/com/contentstack/sdk/CSHttpConnection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ public void send() {
241241
headers.put("User-Agent", defaultUserAgent());
242242
headers.put("X-User-Agent", "contentstack-android/" + SDKConstant.SDK_VERSION);
243243
jsonObjectRequest = new JSONUTF8Request(requestId, url, requestJSON, response -> {
244-
responseJSON = response;
245-
if (responseJSON != null) {
244+
this.responseJSON = response;
245+
if (this.responseJSON != null) {
246246
connectionRequest.onRequestFinished(CSHttpConnection.this);
247247
}
248248
}, this::generateBuiltError) {

contentstack/src/main/java/com/contentstack/sdk/Config.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ public void setBranch(String branch) {
4242
* <b>Note:</b> Default region sets to us </a>
4343
*
4444
* <br><br><b>Example For Different Regions:</b><br>
45-
* <pre class="prettyprint">
46-
* config.setRegion(ContentstackRegion.US);
47-
* config.setRegion(ContentstackRegion.EU);
48-
* config.setRegion(ContentstackRegion.AZURE_EU);
49-
* config.setRegion(ContentstackRegion.AZURE_NA);
50-
* </pre>
45+
* <pre>
46+
* {@code
47+
* config.setRegion(ContentstackRegion.US);
48+
* config.setRegion(ContentstackRegion.EU);
49+
* config.setRegion(ContentstackRegion.AZURE_EU);
50+
* config.setRegion(ContentstackRegion.AZURE_NA);
51+
* }
52+
* </pre>
5153
*/
5254
public ContentstackRegion setRegion(ContentstackRegion region) {
5355
this.region = region;

contentstack/src/main/java/com/contentstack/sdk/Contentstack.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public static Stack stack(@NotNull Context context, @NotNull String apiKey, @Not
4848
if (!TextUtils.isEmpty(apiKey) || !TextUtils.isEmpty(deliveryToken) || !TextUtils.isEmpty(environment)) {
4949
Config config = new Config();
5050
config.setEnvironment(environment);
51+
ctx = context;
5152
return initializeStack(context, apiKey, deliveryToken, config);
5253
} else {
5354
throw new Exception(SDKConstant.EMPTY_CREDENTIALS_NOT_ALLOWED);
@@ -71,6 +72,7 @@ public static Stack stack(@NotNull Context context, @NotNull String apiKey, @Not
7172
public static Stack stack(@NotNull Context context, @NotNull String apiKey, @NotNull String deliveryToken, @NotNull String environment, @NotNull Config config) throws Exception {
7273
if (!TextUtils.isEmpty(apiKey) || !TextUtils.isEmpty(deliveryToken) || !TextUtils.isEmpty(environment)) {
7374
config.setEnvironment(environment);
75+
ctx = context;
7476
return initializeStack(context, apiKey, deliveryToken, config);
7577
} else {
7678
throw new Exception(SDKConstant.EMPTY_CREDENTIALS_NOT_ALLOWED);

0 commit comments

Comments
 (0)