Skip to content
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

Serializer fires warning when using HashMap as a property for a Http Request Body bean #6

Open
gbatchvarov opened this issue Mar 26, 2021 · 0 comments

Comments

@gbatchvarov
Copy link

gbatchvarov commented Mar 26, 2021

General information

  • SDK/Library version: 1.0.1
  • Java Version: 8

Issue description

I am working on my integration with PayPal Marketspace and I am using the Payment/Order V2 SDKs which references paypalhttp_java SDK. I noticed that the Seller Onboarding process has not been implemented so I had to build it my self. I created the following class:

`
@model
public class PartnerReferralRequestBody {

@SerializedName("tracking_id")
private String trackingId;

@SerializedName("email")
private String email;

@SerializedName("operations")
private List<Map<String, Object>> operations;

@SerializedName("products")
private List<String> products;

public PartnerReferralRequestBody() {
}

public PartnerReferralRequestBody(String hostId, String email) {
	this.trackingId = hostId;
	this.email = email;

	// Initialize the products
	this.products = new ArrayList<String>();
	this.products.add("EXPRESS_CHECKOUT");

	// Initialize the operations
	this.operations = new ArrayList<Map<String,Object>>();
	Map<String,Object> operation = new HashMap<String,Object>();
		operation.put("operation", "API_INTEGRATION");
		Map<String,Object> preference = new HashMap<String,Object>();
			Map<String,Object> integration = new HashMap<String,Object>();
				integration.put("integration_method", "PAYPAL");
				integration.put("integration_type", "THIRD_PARTY");
				Map<String,Object> details = new HashMap<String,Object>();
					ArrayList<String> features = new ArrayList<String>();
					features.add("PAYMENT");
					features.add("REFUND");
					details.put("features", features);
				integration.put("third_party_details", details);
			preference.put("rest_api_integration", integration);
		operation.put("api_integration_preference", preference);
	this.operations.add(operation);
}

public String getTrackingId() {
	return trackingId;
}

public void setTrackingId(String trackingId) {
	this.trackingId = trackingId;
}

public String getEmail() {
	return email;
}

public void setEmail(String email) {
	this.email = email;
}

public List<Map<String, Object>> getOperations() {
	return operations;
}

public void setOperations(List<Map<String, Object>> operations) {
	this.operations = operations;
}

public List<String> getProducts() {
	return products;
}

public void setProducts(List<String> products) {
	this.products = products;
}

}
`
and I got the following warning when I tried to make the following call:

PartnerReferralRequestBody requestBody = new PartnerReferralRequestBody(hostId, email); BaseHttpClient<PartnerReferralResponse> request= new BaseHttpClient<PartnerReferralResponse>("/v2/customer/partner-referrals", "POST", PartnerReferralResponse.class); request.requestBody(requestBody); HttpResponse<PartnerReferralResponse> response = paypalClient.execute(request);

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.paypal.http.serializer.ObjectMapper (file:/C:/Users/gibatchv/.m2/repository/com/paypal/paypalhttp/1.0.1/paypalhttp-1.0.1.jar) to field java.util.HashMap.serialVersionUID
WARNING: Please consider reporting this to the maintainers of com.paypal.http.serializer.ObjectMapper
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Is this going to be a problem with any Bean implementing Serializable ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant