public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mike Hearn <mike@plan99.net>
To: Bryce McKinlay <bmckinlay@gmail.com>
Cc: GCC Java <java@gcc.gnu.org>
Subject: Re: Which library implementation to use/work on?
Date: Sun, 08 Apr 2012 13:18:00 -0000	[thread overview]
Message-ID: <CANEZrP3BErQkT+TyJ3i4fNcaRz6tce5mGimAyK851qjC7NcHcA@mail.gmail.com> (raw)
In-Reply-To: <CALUNu-rKCMdSpzNw2rbkB7vc8rgvMb9vp9-f_3AidMVTObfjwg@mail.gmail.com>

Thanks, I got it to work eventually. That switch disables building of
ecj so I had to first compile without it, then install, then adjust my
path, then reconfigure/make/make install - bit confusing.

I then encountered a couple of other issues. Firstly it seems there's
something odd about the Google protocol buffers library that gcj does
not like:

com/google/protobuf/SingleFieldBuilder.java: In method
'com.google.protobuf.SingleFieldBuilder.mergeFrom(com.google.protobuf.GeneratedMessage)':
com/google/protobuf/SingleFieldBuilder.java:192:0: error: class
'com.google.protobuf.GeneratedMessage' has no method named
'getDefaultInstanceForType' matching signature
'()Lcom/google/protobuf/Message;'

The code is some morass of generics so it's hard for me to figure out
what the issue is here. The relevant code is:

public class SingleFieldBuilder
    <MType extends GeneratedMessage,
     BType extends GeneratedMessage.Builder,
     IType extends MessageOrBuilder>
    implements GeneratedMessage.BuilderParent {

  ....
  private MType message;

  public SingleFieldBuilder<MType, BType, IType> mergeFrom(
      MType value) {
    if (builder == null && message == message.getDefaultInstanceForType()) {
      message = value;
    } else {
      getBuilder().mergeFrom(value);
    }
    onChanged();
    return this;
  }
}

Sure enough the GeneratedMessage class doesn't have
getDefaultInstanceForType - it's implemented by subclasses.

GeneratedMessage says this at the top:


/**
 * All generated protocol message classes extend this class.  This class
 * implements most of the Message and Builder interfaces using Java reflection.
 * Users can ignore this class and pretend that generated messages implement
 * the Message interface directly.
 *
 * @author kenton@google.com Kenton Varda
 */

I suspect the reference to "implementing most of the interfaces using
reflection" is key. I don't know what that means exactly, the class is
very large and complicated:

http://code.google.com/p/protobuf/source/browse/trunk/java/src/main/java/com/google/protobuf/GeneratedMessage.java

I switched to the "lite" runtime which is simpler and the issue went away.

The next problem is more stubs in classpath: specifically the elliptic
curve related classes in java.security.spec. I'm already using
BouncyCastle to implement the EC crypto - these classes are literally
just data structures. They're probably quite trivial to do.

I'll try copying the equivalent code from openjdk and see if that works.

  reply	other threads:[~2012-04-08 13:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 16:57 Mike Hearn
2012-03-13 17:07 ` Andrew Haley
2012-03-13 18:26 ` Mike Hearn
2012-03-13 18:39   ` Andrew Haley
2012-03-14 10:40   ` Mike Hearn
2012-03-14 10:43     ` Chris Burdess
2012-03-14 11:11       ` Mike Hearn
2012-03-14 11:12         ` Andrew Haley
2012-03-14 12:14 ` Andrew Hughes
2012-03-14 12:17   ` Mike Hearn
2012-03-14 12:31     ` Andrew Hughes
2012-03-14 12:35       ` Mike Hearn
2012-03-14 18:32         ` Andrew Hughes
2012-03-15 12:24           ` Mike Hearn
2012-03-15 12:37             ` Andrew Hughes
2012-04-07 15:29               ` Mike Hearn
2012-04-07 18:28                 ` Bryce McKinlay
2012-04-08 13:18                   ` Mike Hearn [this message]
2012-04-10 15:53                     ` Mike Hearn
     [not found]                       ` <CANEZrP2ukT8zjNjma9yBREJ6wEuhdU6Qb=bPSOjemTYjzwrH5g@mail.gmail.com>
     [not found]                         ` <CANEZrP0QcpHjxKHWoi=A8+CcE2gPzm2_eO4_PG5=BmMHj-f_+Q@mail.gmail.com>
2012-05-30 21:14                           ` Mike Hearn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANEZrP3BErQkT+TyJ3i4fNcaRz6tce5mGimAyK851qjC7NcHcA@mail.gmail.com \
    --to=mike@plan99.net \
    --cc=bmckinlay@gmail.com \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).