Skip to content

MLE-23146 Address compile warnings in src/main/java #1810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static void runShortcut(ExampleProperties props) throws IOException {
String docId = "/example/"+filename;

// parse the example file with GSON
JsonElement writeDocument = new JsonParser().parse(
JsonElement writeDocument = JsonParser.parseReader(
new InputStreamReader(docStream, "UTF-8"));

// write the document
Expand Down Expand Up @@ -99,7 +99,7 @@ public static void runStrongTyped(ExampleProperties props) throws IOException {
GSONHandle writeHandle = new GSONHandle();

// parse the example file with GSON
JsonElement writeDocument = writeHandle.getParser().parse(
JsonElement writeDocument = JsonParser.parseReader(
new InputStreamReader(docStream, "UTF-8"));
writeHandle.set(writeDocument);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import static org.junit.jupiter.api.Assertions.*;

@SuppressWarnings("unchecked")
public class TestSplitters extends BasicJavaClientREST {
private static String dbName = "TestSplittersDB";
private static String[] fNames = {"TestSplittersDB-1"};
Expand Down Expand Up @@ -1050,6 +1051,7 @@ public void setFileStream(FileInputStream fileStream) {
}

@Override
@SuppressWarnings("unchecked")
public void run() {
Stream<StringHandle> contentStream = null;
Charset cs = Charset.forName("UTF-8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public void testRowBatcherWithJackson() {
PlanBuilder p = rowMgr.newPlanBuilder();
PlanBuilder.ModifyPlan plan = p.fromView("opticFunctionalTest", "detail");
rowsBatcherOfJsonObj.withBatchView(plan);
ArrayList<Double> exptdAmt = new ArrayList(Arrays.asList(10.01,20.02,30.03,40.04,50.05,60.06));
ArrayList<Double> resultAmt = new ArrayList<>();
List<Double> exptdAmt = Arrays.asList(10.01,20.02,30.03,40.04,50.05,60.06);
List<Double> resultAmt = new ArrayList<>();

rowsBatcherOfJsonObj.onSuccess(e ->{
JsonNode resDoc = e.getRowsDoc().get("rows");
Expand Down Expand Up @@ -117,8 +117,8 @@ public void testJoinInner() {
p.col( "color")
);
rowsBatcherOfJsonObj.withBatchView(plan3);
ArrayList<Double> exptdAmt = new ArrayList(Arrays.asList(10.01,20.02,30.03,40.04,50.05,60.06));
ArrayList<Double> resultAmt = new ArrayList<>();
List<Double> exptdAmt = Arrays.asList(10.01,20.02,30.03,40.04,50.05,60.06);
List<Double> resultAmt = new ArrayList<>();

rowsBatcherOfJsonObj.onSuccess(e ->{
JsonNode resDoc = e.getRowsDoc().get("rows");
Expand Down Expand Up @@ -168,8 +168,8 @@ public void testWithExpressioncolumns() {
p.as("divided", p.divide(p.col("amount"), p.multiply(p.col("amount"), p.viewCol("detail", "id"))))
);
rowsBatcherOfJsonObj.withBatchView(plan3);
ArrayList<Double> exptdAmt = new ArrayList(Arrays.asList(11.01, 22.02, 31.03, 42.04, 51.05, 62.06));
ArrayList<Double> resultAmt = new ArrayList<>();
List<Double> exptdAmt = Arrays.asList(11.01, 22.02, 31.03, 42.04, 51.05, 62.06);
List<Double> resultAmt = new ArrayList<>();

rowsBatcherOfJsonObj.onSuccess(e -> {
JsonNode resDoc = e.getRowsDoc().get("rows");
Expand Down Expand Up @@ -259,9 +259,9 @@ public void testMultipleSuccessListener() {
PlanBuilder p = rowMgr.newPlanBuilder();
PlanBuilder.ModifyPlan plan = p.fromView("opticFunctionalTest", "detail");
rowsBatcherOfJsonObj.withBatchView(plan);
ArrayList<Double> exptdAmt = new ArrayList(Arrays.asList(10.01,20.02,30.03,40.04,50.05,60.06));
ArrayList<Double> resultAmt1 = new ArrayList<>();
ArrayList<Double> resultAmt2 = new ArrayList<>();
List<Double> exptdAmt = Arrays.asList(10.01,20.02,30.03,40.04,50.05,60.06);
List<Double> resultAmt1 = new ArrayList<>();
List<Double> resultAmt2 = new ArrayList<>();
rowsBatcherOfJsonObj.onSuccess(e ->{
JsonNode resDoc = e.getRowsDoc().get("rows");

Expand Down Expand Up @@ -364,8 +364,8 @@ public void testExceptionInSecondSuccessListener() {
PlanBuilder p = rowMgr.newPlanBuilder();
PlanBuilder.ModifyPlan plan = p.fromView("opticFunctionalTest", "detail");
rowsBatcherOfJsonObj.withBatchView(plan);
ArrayList<Double> exptdAmt = new ArrayList(Arrays.asList(10.01, 20.02, 30.03, 40.04, 50.05, 60.06));
ArrayList<Double> resultAmt1 = new ArrayList<>();
List<Double> exptdAmt = Arrays.asList(10.01, 20.02, 30.03, 40.04, 50.05, 60.06);
List<Double> resultAmt1 = new ArrayList<>();

rowsBatcherOfJsonObj.onSuccess(e -> {
JsonNode resDoc = e.getRowsDoc().get("rows");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;




@SuppressWarnings("unchecked")
public class TestDocumentFormat extends AbstractFunctionalTest {

@BeforeAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;

@SuppressWarnings("unchecked")
public class TestDocumentMimetype extends AbstractFunctionalTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ public void testJSReturningDifferentTypesOrder3fromModules() throws Exception {
DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle();
metadataHandle.getPermissions().add("test-js-eval",
Capability.UPDATE, Capability.READ, Capability.EXECUTE);
DocumentManager dm = moduleClient.newDocumentManager();
TextDocumentManager dm = moduleClient.newTextDocumentManager();
dm.write("/data/javascriptQueries.sjs", metadataHandle, ish);
/*DocumentBuilder db = DocumentBuilderFactory.newInstance()
.newDocumentBuilder();*/
Expand Down Expand Up @@ -648,7 +648,7 @@ public void testJavaScriptModules() {
mjsString + "export default output;" :
mjsString + "output";

DocumentManager dm = moduleClient.newDocumentManager();
TextDocumentManager dm = moduleClient.newTextDocumentManager();
DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle();
metadataHandle.getPermissions().add("test-js-eval",
Capability.UPDATE, Capability.READ, Capability.EXECUTE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.marklogic.client.DatabaseClient;
import com.marklogic.client.FailedRequestException;
import com.marklogic.client.document.DocumentManager;
import com.marklogic.client.document.TextDocumentManager;
import com.marklogic.client.eval.EvalResult;
import com.marklogic.client.eval.EvalResult.Type;
import com.marklogic.client.eval.EvalResultIterator;
Expand Down Expand Up @@ -413,7 +414,7 @@ public void testXqueryInvokeModuleRetDiffTypes() throws Exception {
ish.set(inputStream);
DocumentMetadataHandle metadataHandle = new DocumentMetadataHandle();
metadataHandle.getPermissions().add("test-eval", Capability.UPDATE, Capability.READ, Capability.EXECUTE);
DocumentManager dm = moduleClient.newDocumentManager();
TextDocumentManager dm = moduleClient.newTextDocumentManager();
dm.write("/data/xquery-modules-with-diff-variable-types.xqy", metadataHandle, ish);
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
InputSource is = new InputSource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.regex.Pattern;


@SuppressWarnings("unchecked")
public class TestOpticEnhancements extends AbstractFunctionalTest {

private static Map<String, Object>[] literals1 = new HashMap[10];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.HashMap;
import java.util.Map;

@SuppressWarnings("unchecked")
public class TestOpticOnLiterals extends AbstractFunctionalTest {

private static Map<String, Object>[] literals1 = new HashMap[5];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/* The tests here are for sanity checks when we have plans from different sources
* such as fromLexicons and fromtriples.
*/

@SuppressWarnings("unchecked")
public class TestOpticOnMixedViews extends AbstractFunctionalTest {

@BeforeAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void validateArtifact(Artifact art)
assertTrue( art.getInventory() > 1000);
}

@SuppressWarnings("unchecked")
public void loadSimplePojos(PojoRepository products)
{
for (int i = 1; i < 111; i++) {
Expand Down Expand Up @@ -133,6 +134,7 @@ public void testPOJOContainerQuerySearchWithWord() {
// Below scenario is to test container query builder with wild card options in
// word query
@Test
@SuppressWarnings("unchecked")
public void testPOJOwordSearchWithContainerQueryBuilder() {
PojoRepository<Artifact, Long> products = client.newPojoRepository(Artifact.class, Long.class);
PojoPage<Artifact> p;
Expand Down Expand Up @@ -240,7 +242,8 @@ public void testPOJORangeQuerySearchWithOptions() {
// Below scenario is verifying and query with all pojo builder methods

@Test
public void testPOJOWordSearchWithOptions() throws KeyManagementException, NoSuchAlgorithmException, Exception {
@SuppressWarnings("unchecked")
public void testPOJOWordSearchWithOptions() {
PojoRepository<Artifact, Long> products = client.newPojoRepository(Artifact.class, Long.class);
PojoPage<Artifact> p;
this.loadSimplePojos(products);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public void validateArtifact(GeoSpecialArtifact art)
assertTrue( art.getInventory() > 1000);
}

@SuppressWarnings("unchecked")
public void loadSimplePojos(PojoRepository products)
{
for (int i = 1; i < 111; i++) {
Expand All @@ -96,6 +97,7 @@ public void loadSimplePojos(PojoRepository products)
// This test is to verify GeoPair query works fine,
// searching for lattitud and longitude of Reno
@Test
@SuppressWarnings("unchecked")
public void testPOJOGeoQuerySearchWithGeoPair() {
PojoRepository<GeoSpecialArtifact, Long> products = client.newPojoRepository(GeoSpecialArtifact.class, Long.class);
PojoPage<GeoSpecialArtifact> p;
Expand Down Expand Up @@ -135,6 +137,7 @@ public void testPOJOGeoQuerySearchWithGeoPair() {

// This test is to verify GeoProperty query works fine
@Test
@SuppressWarnings("unchecked")
public void testPOJOGeoQuerySearchWithGeoProperty() {
PojoRepository<GeoSpecialArtifact, Long> products = client.newPojoRepository(GeoSpecialArtifact.class, Long.class);
PojoPage<GeoSpecialArtifact> p;
Expand Down Expand Up @@ -170,6 +173,7 @@ public void testPOJOGeoQuerySearchWithGeoProperty() {
// This test is to verify GeoPath query works fine,
// searching for lattitud and longitude of Reno
@Test
@SuppressWarnings("unchecked")
public void testPOJOGeoQuerySearchWithGeoPath() {
PojoRepository<GeoSpecialArtifact, Long> products = client.newPojoRepository(GeoSpecialArtifact.class, Long.class);
PojoPage<GeoSpecialArtifact> p;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public void validateArtifact(Artifact art) {
assertTrue( art.getInventory() > 1000);
}

@SuppressWarnings("unchecked")
public void loadSimplePojos(PojoRepository products) {
for (int i = 1; i < 111; i++) {
if (i % 2 == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ public void testPOJORangeQueryOnCalendar() throws Exception {
assertEquals( 1, p.getTotalPages());
}

@SuppressWarnings("unchecked")
public void loadSimplePojos(PojoRepository rangeQueryRepos) {
for (int i = 1; i < 111; i++) {
if (i % 2 == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public void validateArtifact(Artifact art)
assertNotNull( art.getInventory() > 1000);
}

@SuppressWarnings("unchecked")
public void loadSimplePojos(PojoRepository products)
{
for (int i = 1; i < 111; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void validateArtifact(Artifact art)
assertTrue( art.getInventory() > 1000);
}

@SuppressWarnings("unchecked")
public void loadSimplePojos(PojoRepository products)
{
for (int i = 1; i < 111; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public void validateArtifact(Artifact art)
assertTrue( art.getInventory() > 1000);
}

@SuppressWarnings("unchecked")
public void loadSimplePojos(PojoRepository products)
{
for (int i = 1; i < 111; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void testAInsertAndUpdateJson() throws KeyManagementException, NoSuchAlgo
for (String filename : filenames) {
writeDocumentUsingInputStreamHandle(client, filename, "/partial-update/", "JSON");
}
DocumentManager docMgrIns = client.newJSONDocumentManager();
JSONDocumentManager docMgrIns = client.newJSONDocumentManager();
// create handle
JacksonHandle jacksonHandle = new JacksonHandle();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.custommonkey.xmlunit.XMLAssert.assertXpathEvaluatesTo;


@SuppressWarnings("unchecked")
public class TestRollbackTransaction extends AbstractFunctionalTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.marklogic.client.DatabaseClient;
import com.marklogic.client.Transaction;
import com.marklogic.client.document.DocumentManager;
import com.marklogic.client.document.XMLDocumentManager;
import com.marklogic.client.io.SearchHandle;
import com.marklogic.client.io.StringHandle;
import com.marklogic.client.query.QueryManager;
Expand All @@ -25,13 +26,13 @@ public class TestSearchMultipleForests extends AbstractFunctionalTest {
private static String[] fNames = { "java-functest-1", "java-functest-2" };

@Test
public void testSearchMultipleForest() throws KeyManagementException, NoSuchAlgorithmException, IOException
public void testSearchMultipleForest()
{
System.out.println("Running testSearchMultipleForest");
// connect the client
DatabaseClient client = getDatabaseClient("rest-writer", "x", getConnType());

DocumentManager docMgr = client.newDocumentManager();
XMLDocumentManager docMgr = client.newXMLDocumentManager();
StringHandle writeHandle1 = new StringHandle();
for (int a = 1; a <= 10; a++) {
writeHandle1.set("<root>hello</root>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.util.*;

import com.marklogic.client.document.JSONDocumentManager;
import com.marklogic.client.fastfunctest.AbstractFunctionalTest;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -183,7 +184,7 @@ public void testWithSnapshots() {
System.out.println("Batch Numer is " + batch.getJobBatchNumber());
if (batch.getJobBatchNumber() == 1) {
// Attempt to read firstName11 from database
DocumentManager docMgr = dbClient.newJSONDocumentManager();
JSONDocumentManager docMgr = dbClient.newJSONDocumentManager();
JacksonHandle jacksonhandle = new JacksonHandle();
docMgr.read("firstName11.json", jacksonhandle);
JsonNode node = jacksonhandle.get();
Expand Down Expand Up @@ -307,7 +308,7 @@ public void testNoSnapshotOnListener() {
System.out.println("Batch Numer is " + batch.getJobBatchNumber());
if (batch.getJobBatchNumber() == 1) {
// Attempt to read firstName11 from database
DocumentManager docMgr = dbClient.newJSONDocumentManager();
JSONDocumentManager docMgr = dbClient.newJSONDocumentManager();
JacksonHandle jacksonhandle = new JacksonHandle();
docMgr.read("firstName11.json", jacksonhandle);
JsonNode node = jacksonhandle.get();
Expand Down
Loading