Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 676239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:54:22+00:00 2026-05-14T00:54:22+00:00

The opposite of this question: How do I add a type to GWT's Serialization

  • 0

The opposite of this question: How do I add a type to GWT's Serialization Policy whitelist?

GWT is adding undesired types to the serialization policy and bloating my JS. How do I trim my GWT whitelist by hand? Or should I at all?

For example, if I put the interface List on a GWT RPC service class, GWT has to generate Javascript that handles ArrayList, LinkedList, Stack, Vector, … even though my team knows we’re only ever going to return an ArrayList. I could just make the method’s return type ArrayList, but I like relying on an interface rather than a specific implementation. After all, maybe one day we will switch it up and return e.g. a LinkedList. In that case, I’d like to force the GWT serialization policy to compile for only ArrayList and LinkedList. No Stacks or Vectors.

These implicit restrictions have one huge downside I can think of: a new member of the team starts returning Vectors, which will be a runtime error. So besides the question in the title, what is your experience designing around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:54:22+00:00Added an answer on May 14, 2026 at 12:54 am

    There is a property that can do this class blacklisting. For example, to blacklist non-ArrayList Collections, add these lines to your *.gwt.xml:

    <extend-configuration-property name="rpc.blacklist" value="java.util.HashSet"/>
    <extend-configuration-property name="rpc.blacklist" value="java.util.LinkedHashSet"/>
    <extend-configuration-property name="rpc.blacklist" value="java.util.LinkedList"/>
    <extend-configuration-property name="rpc.blacklist" value="java.util.Stack"/>
    <extend-configuration-property name="rpc.blacklist" value="java.util.TreeMap"/>
    <extend-configuration-property name="rpc.blacklist" value="java.util.TreeSet"/>
    <extend-configuration-property name="rpc.blacklist" value="java.util.Vector"/>
    

    This was necessary for me to reduce JS size when sending GWT’s built-in com.google.gwt.user.client.ui.SuggestOracle$Response objects over the wire. Such objects contain a java.util.Collection, but I knew I would only ever be sending back an ArrayList.

    I still respect the advantages of compile-time checks as discussed in the other responses, comments, and my original question. Indeed, this is a flaky solution if GWT starts picking up additional implementations to serialize (why is this not a whitelist?). However this “rpc.blacklist” property saved me from rolling my own SuggestOracle just to get a more specific collection type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I seem to have the exact opposite problem than this question on stopping dock
(This question is the opposite of this one ) How can I go from
This is similar to this question , but kind of the opposite. I have
Opposite of this question: Retain anchor after postback in asp.net I'm having the issue
This might be the exact opposite of this question . Consider the following spec:
This question is the opposite of Collect several input fields and insert into a
As a kind of opposite to this question: Is low-level embedded systems programming hard
I have basically the opposite problem to this question: How to prevent iframe from
This question is pretty much the opposite of this question: Does C# have built-in
I want to do the opposite of this question , and sort of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.