Skip to content

Commit 2dbf26c

Browse files
committed
warnings cleanup
1 parent 12a046b commit 2dbf26c

File tree

9 files changed

+19
-28
lines changed

9 files changed

+19
-28
lines changed

src/main/java/com/microsoft/graph/core/BaseActionRequestBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ protected boolean hasParameter(final String name) {
5353
* @param <T> The type to which this object should be cast
5454
* @return The stored instance of T, otherwise null
5555
*/
56+
@SuppressWarnings("unchecked")
5657
protected <T> T getParameter(final String name) {
5758
return (T) bodyParams.get(name);
5859
}

src/main/java/com/microsoft/graph/core/ClientException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
*/
2828
public class ClientException extends RuntimeException {
2929

30+
private static final long serialVersionUID = -1066560879567392559L;
31+
3032
/**
3133
* Creates the client exception.
3234
* @param message The message to display.

src/main/java/com/microsoft/graph/http/BaseRequestBuilder.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ public abstract class BaseRequestBuilder implements IRequestBuilder {
5050
*/
5151
private final List<Option> options = new ArrayList<>();
5252

53-
private final IJsonBackedObject body;
54-
5553
/**
5654
* Creates the request builder.
5755
*
@@ -66,23 +64,6 @@ public BaseRequestBuilder(
6664
) {
6765
this.requestUrl = requestUrl;
6866
this.client = client;
69-
this.body = null;
70-
71-
if (options != null) {
72-
this.options.addAll(options);
73-
}
74-
}
75-
76-
public BaseRequestBuilder(
77-
final String requestUrl,
78-
final IJsonBackedObject body,
79-
final IBaseClient client,
80-
final List<? extends Option> options
81-
) {
82-
this.requestUrl = requestUrl;
83-
this.client = client;
84-
this.body = body;
85-
8667
if (options != null) {
8768
this.options.addAll(options);
8869
}

src/main/java/com/microsoft/graph/http/GraphFatalServiceException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
*/
3030
public class GraphFatalServiceException extends GraphServiceException {
3131

32+
private static final long serialVersionUID = -4974392424026672738L;
33+
3234
/**
3335
* Create a fatal Graph service exception.
3436
* @param method The method that caused the exception.

src/main/java/com/microsoft/graph/http/GraphServiceException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
*/
4343
public class GraphServiceException extends ClientException {
4444

45+
private static final long serialVersionUID = -7416427229421064119L;
46+
4547
/**
4648
* New line delimiter.
4749
*/

src/main/java/com/microsoft/graph/logger/DefaultLogger.java

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

2323
package com.microsoft.graph.logger;
2424

25-
import java.util.logging.Level;
2625
import java.util.logging.Logger;
2726

2827
/**

src/main/java/com/microsoft/graph/serializer/AdditionalDataManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
public class AdditionalDataManager extends HashMap<String, JsonElement> {
3737

38+
private static final long serialVersionUID = 8641634955796941429L;
39+
3840
private final transient IJsonBackedObject jsonBackedObject;
3941

4042
public AdditionalDataManager(IJsonBackedObject jsonBackedObject) {

src/main/java/com/microsoft/graph/serializer/DefaultSerializer.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.HashMap;
3232
import java.util.Iterator;
3333
import java.util.Map;
34+
import java.util.Map.Entry;
3435

3536
/**
3637
* The default serializer implementation for the SDK.
@@ -151,8 +152,9 @@ private JsonObject getChildAdditionalData(IJsonBackedObject serializableObject,
151152

152153
// If the object is a HashMap, iterate through its children
153154
if (fieldObject instanceof HashMap) {
154-
HashMap<String, Object> serializableChildren = (HashMap<String, Object>) fieldObject;
155-
Iterator it = serializableChildren.entrySet().iterator();
155+
@SuppressWarnings("unchecked")
156+
HashMap<String, Object> serializableChildren = (HashMap<String, Object>) fieldObject;
157+
Iterator<Entry<String, Object>> it = serializableChildren.entrySet().iterator();
156158

157159
while (it.hasNext()) {
158160
HashMap.Entry<String, Object> pair = (HashMap.Entry<String, Object>)it.next();
@@ -222,7 +224,7 @@ private boolean fieldIsOdataTransient(Map.Entry<String, JsonElement> entry) {
222224
* @param parentClass The parent class the derived class should inherit from
223225
* @return The derived class if found, or null if not applicable
224226
*/
225-
private Class getDerivedClass(JsonObject jsonObject, Class parentClass) {
227+
private Class<?> getDerivedClass(JsonObject jsonObject, Class<?> parentClass) {
226228
//Identify the odata.type information if provided
227229
if (jsonObject.get("@odata.type") != null) {
228230
String odataType = jsonObject.get("@odata.type").getAsString();
@@ -231,7 +233,7 @@ private Class getDerivedClass(JsonObject jsonObject, Class parentClass) {
231233
derivedType = "com.microsoft.graph.models.extensions." + derivedType; //Add full package path
232234

233235
try {
234-
Class derivedClass = Class.forName(derivedType);
236+
Class<?> derivedClass = Class.forName(derivedType);
235237
//Check that the derived class inherits from the given parent class
236238
if (parentClass.isAssignableFrom(derivedClass)) {
237239
return derivedClass;

src/main/java/com/microsoft/graph/serializer/GsonFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ public DateOnly deserialize(final JsonElement json,
162162
}
163163
};
164164

165-
final JsonSerializer<EnumSet> enumSetJsonSerializer = new JsonSerializer<EnumSet>() {
165+
final JsonSerializer<EnumSet<?>> enumSetJsonSerializer = new JsonSerializer<EnumSet<?>>() {
166166
@Override
167-
public JsonElement serialize(final EnumSet src,
167+
public JsonElement serialize(final EnumSet<?> src,
168168
final Type typeOfSrc,
169169
final JsonSerializationContext context) {
170170
if (src == null || src.isEmpty()) {
@@ -175,9 +175,9 @@ public JsonElement serialize(final EnumSet src,
175175
}
176176
};
177177

178-
final JsonDeserializer<EnumSet> enumSetJsonDeserializer = new JsonDeserializer<EnumSet>() {
178+
final JsonDeserializer<EnumSet<?>> enumSetJsonDeserializer = new JsonDeserializer<EnumSet<?>>() {
179179
@Override
180-
public EnumSet deserialize(final JsonElement json,
180+
public EnumSet<?> deserialize(final JsonElement json,
181181
final Type typeOfT,
182182
final JsonDeserializationContext context) throws JsonParseException {
183183
if (json == null) {

0 commit comments

Comments
 (0)