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

  • Home
  • SEARCH
  • 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 7797529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:42:48+00:00 2026-06-01T23:42:48+00:00

The following code is a GWT RPC serlvet implementation , the transformed collection fails

  • 0

The following code is a GWT RPC serlvet implementation ,
the transformed collection fails in the client obviously since the since it is not GWT compatible.

Any soutions inside Guava that I am missing ?

@Singleton
public class DataServiceImpl extends RemoteServiceServlet implements
        DataService {

    @Inject
    ApplicationDao dao;

    @Inject
    DtoUtil dtoUtil;

    public Collection<GoalDto> getAllConfiguredGoals() {
        return Collections2.transform(dao.getAllGoals(), new Function<Goal, GoalDto>() {
            public GoalDto apply(@Nullable Goal goal) {
                return dtoUtil.toGoalDto(goal);
            }
        });
    }

}

I am looking for a native guava solution , not some hand written translation code.

  • 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-06-01T23:42:49+00:00Added an answer on June 1, 2026 at 11:42 pm

    The problem with guava in this case is that it uses Lazy-evaluation (which is often good, but not here) and the collection is backed-up by the original collection. The only way out would be to force a new collection which is not backed-up by original objects and where all evaluations have been performed. Something like this should do the trick (assuming that GoalDto is GWT-serializable):

    return new ArrayList<GoalDto>(Collections2.transform(dao.getAllGoals(), new Function<Goal, GoalDto>() {
            public GoalDto apply(@Nullable Goal goal) {
                return dtoUtil.toGoalDto(goal);
            }
        }));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code gives a NullReferenceException since XPathSelectElement can't navigate through the XPath expression
I have the following code from a GWT Project that is part of the
I have installed the GWT plugin in eclipse, how run the following code? I
Using GWT 1.6.4, I have the following code to retrieve the dimensions of the
I'm using the following code in gwt: <g:DockLayoutPanel unit='EM'> <g:north size='5'> <g:Label>www.wing-project.org</g:Label> </g:north> <g:west
I have the following code in my presenter in a GWT MVP application: public
I am following GWT tutorial from code.google.com. I build an application using webAppCreator &
The following gwt jsni method code only works when I have firebug open, I
I've been following the tutorial on building a sample GWT Application: http://code.google.com/webtoolkit/doc/latest/tutorial/gettingstarted.html I then
Looking at the GWT sample apps and the RPC tutorial the following package conventions

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.