decoration decoration
Stories

GROKLAW
When you want to know more...
decoration
For layout only
Home
Archives
Site Map
Search
About Groklaw
Awards
Legal Research
Timelines
ApplevSamsung
ApplevSamsung p.2
ArchiveExplorer
Autozone
Bilski
Cases
Cast: Lawyers
Comes v. MS
Contracts/Documents
Courts
DRM
Gordon v MS
GPL
Grokdoc
HTML How To
IPI v RH
IV v. Google
Legal Docs
Lodsys
MS Litigations
MSvB&N
News Picks
Novell v. MS
Novell-MS Deal
ODF/OOXML
OOXML Appeals
OraclevGoogle
Patents
ProjectMonterey
Psystar
Quote Database
Red Hat v SCO
Salus Book
SCEA v Hotz
SCO Appeals
SCO Bankruptcy
SCO Financials
SCO Overview
SCO v IBM
SCO v Novell
SCO:Soup2Nuts
SCOsource
Sean Daly
Software Patents
Switch to Linux
Transcripts
Unix Books

Gear

Groklaw Gear

Click here to send an email to the editor of this weblog.


You won't find me on Facebook


Donate

Donate Paypal


No Legal Advice

The information on Groklaw is not intended to constitute legal advice. While Mark is a lawyer and he has asked other lawyers and law students to contribute articles, all of these articles are offered to help educate, not to provide specific legal advice. They are not your lawyers.

Here's Groklaw's comments policy.


What's New

STORIES
No new stories

COMMENTS last 48 hrs
No new comments


Sponsors

Hosting:
hosted by ibiblio

On servers donated to ibiblio by AMD.

Webmaster
API names? | 126 comments | Create New Account
Comments belong to whoever posts them. Please notify us of inappropriate comments.
API names?
Authored by: greed on Thursday, April 19 2012 @ 10:08 PM EDT
For those that do want to know, the Java API to access the Solaris dlopen/dlsym
API is through JNI: "Java Native Interface". The
java.lang.System.loadLibrary(String file) calls into the "dlopen" (or
moral equivalent) routine to load the specified shared object file.

Then, any method with the "native" qualifier will be cause
"dlsym" to be invoked, arguments marshalled, and the native binary
invoked. On return from the native code, results are put back into the format
needed for JVM bytecode and bytecode execution resumes.

Actually, most of he work on "understanding" Java objects is actually
done in the native binary code. Pointers, for the most part, get passed into
the native code. Then there are helper subroutines in the JVM native binary
code that help translate Java objects and types into formats more suitable for C
(or C++ or Objective C or assembly).

That's the best way to do that sort of thing: you don't want to spend time
turning a Java array into a C array if it turns out you aren't going to bother
reading anything out of it, or you only need one item, or whatever.

You can call back into Java from native code too: if you have an object pointer,
you can ask the Java environment to invoke methods on it.

There will be other things in the implementation to help it actually run
fast--the last thing you'd want is your native code interface to be slow. (You
either use it to access system routines--file or network I/O--or for speed; say
to take advantage of vector math instructions, or GPGPU features.)

(The dlopen/dlsym, actually the ld.so API, was written for Linux based on the
Sun docs... oh oh. The Linux one has some advantages with respect to multiple
versions of symbols, but only serious system library builders--like the GLIBC
folks, or the compiler folks--use that feature. Especially since it isn't
portable.)

[ Reply to This | Parent | # ]

API names?
Authored by: Anonymous on Friday, April 20 2012 @ 01:12 PM EDT
The names definitely are part of the API. Compiling Java code does not remove those names; they are present in the bytecode (and even JITted binary code) and can be accessed at runtime via reflection.

If you rename a package, class, method or even parameter name, what you now have is a different API (even if the code that implements it is exactly the same).

This is also one reason why the names should not be protected by copyright law: to achieve compatibility with an existing API, you must use the exact same package, class, method and parameter names used in the API.

Google wrote their own implementations of the methods, but they "copied" the public API specification pieces from Sun's java APIs in order to have some source-code compatibility between Sun's Java platform and their new Android platform (both so that programmers could take pieces of programs written for Sun's Java platform, and easily adapt or use those pieces on Google's Android program, and so that programmers could write new code for Android leveraging their existing knowledge of the Java APIs). To achieve this compatibility, there was literally only ONE name they could choose for each package, class, method and parameter mentioned in the Java API specifications. Its a functional requirement in order to achieve compatibility. Therefore, it should not be protected by copyright law.

IANAL.

[ Reply to This | Parent | # ]

Groklaw © Copyright 2003-2013 Pamela Jones.
All trademarks and copyrights on this page are owned by their respective owners.
Comments are owned by the individual posters.

PJ's articles are licensed under a Creative Commons License. ( Details )