error 8: Link to hidden class: android.content.Intent

788 views
Skip to first unread message

Nagender Telkar

unread,
Feb 20, 2011, 2:41:10 PM2/20/11
to Android Building
Hey All,

We keep running into the following 2 issues while trying to compile
parallel gingerbread builds.

1) /frameworks/base/docs/html/guide/appendix/faq/commontasks.jd:-812:
error 8: Link to hidden class: android.content.Intent Intent /
frameworks/base/docs/html/guide/appendix/faq/commontasks.jd:-812:
error 8: Link to hidden class: android.content.Intent label=Intent
.....

2) error 10: Parameter of hidden type android.content.Intent in
android.accessibilityservice.AccessibilityService.onBind()
....

These errors are not consistent errors. They happen infrequently. I
can see that Intent.java is a part of the java-sources-list-uniq.
Intent.java is getting compiled into full_classes_jar correctly when
the build succeeds.

Has anyone else seen this?

Thank you
Nagender

Jean-Baptiste Queru

unread,
Mar 1, 2011, 7:57:49 PM3/1/11
to android-...@googlegroups.com
We routinely see this at Google, and we haven't been able to explain
it. Any help in diagnosing and fixing this issue would be greatly
appreciated.

JBQ

> --
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Nagender Telkar

unread,
Mar 2, 2011, 12:44:03 PM3/2/11
to android-...@googlegroups.com, Jean-Baptiste Queru
Thanks JBQ. 

Here are a few highlights of my debugging. 
* I see that Intent class is not a hidden class. But javadoc somehow thinks it is hidden some times.
* This issue is not reproducible.
* We started seeing it only in GB, not in Froyo.
* When this error occurs
***only one of the two droiddoc-src-list files is present in the out folder. 
***all the jar files that feed into javadoc tool are present in the out folder. 
***all dependencies are present correctly. 

We have gotten around this issue by replacing the offending Errors.error with System.out.println. I know that this might lead to a few broken links in the documentation, but it is better than having the build job fail. 

regards,
Nagender

Jean-Baptiste Queru

unread,
Mar 2, 2011, 12:51:07 PM3/2/11
to android-...@googlegroups.com
Well, I'd rather have the build fail rather than generate incorrect
documentation - application developers might not be happy otherwise
;-)

JBQ

On Wed, Mar 2, 2011 at 9:44 AM, Nagender Telkar

Dominic

unread,
Apr 23, 2011, 1:17:05 AM4/23/11
to Android Building
Hi,

I've been looking into this in the background of other activities and
have found something that may be an issue (though I suspect not the
cause of this problem).

When I print out the class name from Converter.obtainClass(String
className) I find the following junk:

Droiddoc: found class {@link
Droiddoc: found class android.graphics.drawable
Droiddoc: found class <a
Droiddoc: found class <a
Droiddoc: found class <a
Droiddoc: found class <a
Droiddoc: found class android.appwidget
Droiddoc: found class android.view.animation
Droiddoc: found class android.view.animation

Normally, this class, I would have expected, to be a class name - but
this is just garbage. SO, either the regexp finding the relevant
links is broken in some way, or there is some other mischief at work.
Whatever, this clearly looks wrong... I can supply more extensive
logs if requested, but I'm not in a position to recompile javadoc
(which is where I believe these regexp's are).

Any thoughts on what may be going on? (Sorry, I'm just not enough of
a Java programmer to really grok this.)

Thanks
Dominic

On Mar 2, 10:51 am, Jean-Baptiste Queru <j...@android.com> wrote:
> Well, I'd rather have the build fail rather than generate incorrect
> documentation - application developers might not be happy otherwise
> ;-)
>
> JBQ
>
> On Wed, Mar 2, 2011 at 9:44 AM, Nagender Telkar
>
>
>
>
>
>
>
>
>
> <nagender.tel...@gmail.com> wrote:
> > Thanks JBQ.
> > Here are a few highlights of my debugging.
> > * I see thatIntentclass is not a hidden class. But javadoc somehow thinks
> >> > error 8: Link to hidden class: android.content.IntentIntent    /
> >> > frameworks/base/docs/html/guide/appendix/faq/commontasks.jd:-812:
> >> > error 8: Link to hidden class: android.content.Intentlabel=Intent
> >> > .....
>
> >> > 2) error 10: Parameter of hidden type android.content.Intentin
> >> > android.accessibilityservice.AccessibilityService.onBind()
> >> > ....
>
> >> > These errors are not consistent errors. They happen infrequently. I
> >> > can see thatIntent.java is a part of the java-sources-list-uniq.

Dominic

unread,
Apr 23, 2011, 1:20:30 PM4/23/11
to Android Building
Hi JBQ,

There is clearly something badly wrong in the javadoc processing (or
at I believe this to be the case).

The following is a short segment of the output of a method
Converter.obtainClass(String className):

Droiddoc: found class {@link
Droiddoc: found class android.graphics.drawable
Droiddoc: found class <a
Droiddoc: found class <a
Droiddoc: found class <a
Droiddoc: found class <a
Droiddoc: found class android.appwidget
Droiddoc: found class android.view.animation
Droiddoc: found class android.view.animation
Droiddoc: found class
android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
Droiddoc: found class <a

Normally, the string following the ‘found class’ should be a class
name (or so I believe). Clearly there are a lot of lines that are
appear garbage in this. I wonder, if the regexp that looks for tags
is somehow broken or getting confused. From here, I can't see where
the tags originate from to know what might be going wrong.
Unfortunately, these are seen in both the successful and unsuccessful
cases but this clearly looks like a bug. I'm not sure if this is a
problem in droiddoc or javadoc itself.

The only difference in Converter.obtainClass(String className) output
between the good and bad cases is:

dbinks@abait02-bi:~/workspace/dbinks/gingerbread$ diff good.out
bad.out
163c163
< Droiddoc: found class java.util.concurrent.ConcurrentSkipListSet
---
> Droiddoc: found class java.util.concurrent.ConcurrentSkipListSetout/host/linux-x86/bin/dx -JXms16M -JXmx1536M --dex --output=out/target/common/obj/APPS/InternalLocTestApp_intermediates/noproguard.classes-with-local.dex out/target/common/obj/APPS/InternalLocTestApp_intermediates/noproguard.classes.jar
226d225
< Droiddoc: found class javax.xml.transform.TransformerFactory

Which to me, looks as much as anything like the fact that the logging
can’t keep up.

Whatever, the Converter.obtainClass definitely looks wrong.

Thanks
Dominic Binks

On Mar 2, 10:51 am, Jean-Baptiste Queru <j...@android.com> wrote:
> Well, I'd rather have the build fail rather than generate incorrect
> documentation - application developers might not be happy otherwise
> ;-)
>
> JBQ
>
> On Wed, Mar 2, 2011 at 9:44 AM, Nagender Telkar
>
>
>
>
>
>
>
>
>
> <nagender.tel...@gmail.com> wrote:
> > Thanks JBQ.
> > Here are a few highlights of my debugging.
> > * I see thatIntentclass is not a hidden class. But javadoc somehow thinks
> >> > error 8: Link to hidden class: android.content.IntentIntent    /
> >> > frameworks/base/docs/html/guide/appendix/faq/commontasks.jd:-812:
> >> > error 8: Link to hidden class: android.content.Intentlabel=Intent
> >> > .....
>
> >> > 2) error 10: Parameter of hidden type android.content.Intentin
> >> > android.accessibilityservice.AccessibilityService.onBind()
> >> > ....
>
> >> > These errors are not consistent errors. They happen infrequently. I
> >> > can see thatIntent.java is a part of the java-sources-list-uniq.

Dominic Binks

unread,
Apr 30, 2011, 12:05:06 AM4/30/11
to android-...@googlegroups.com
On 4/23/2011 10:20 AM, Dominic wrote:
> Hi JBQ,
>
> There is clearly something badly wrong in the javadoc processing (or
> at I believe this to be the case).
>
> The following is a short segment of the output of a method
> Converter.obtainClass(String className):
>
> Droiddoc: found class {@link

This gives rise to this error in the documentation:
http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#ACTION_CLASS_CHANGED

I'm not sure if the fix is to change the @see {@link BluetoothClass} here:
frameworks/base/core/java/android/bluetooth/BluetoothDevice.java:103 or
thereabouts.

> Droiddoc: found class android.graphics.drawable
> Droiddoc: found class<a
> Droiddoc: found class<a
> Droiddoc: found class<a
> Droiddoc: found class<a

These are just @see <a href="....">blah</a> and seem to work.

I've also got some more of a lead on why this is failing.

In the bad log, earlier on in processing I see this:

Droiddoc: found class Context
Droiddoc: found class Context
Droiddoc: found class Context
Droiddoc: found class Context
Droiddoc: found class Bundle
Droiddoc: found class Context
Droiddoc: found class Context
Droiddoc: found class Context
Droiddoc: found class Context
Droiddoc: found class Context
Droiddoc: found class Context
Droiddoc: found class Uri

This section of log, never appears in the good log.

Additionally in the good log, I see this:

Droiddoc: found class android.content.Intent
Droiddoc: found class android.content.pm.LabeledIntent
Droiddoc: found class android.content.Intent.FilterComparison
Droiddoc: found class android.content.Intent.ShortcutIconResource

Which never appears in the bad log, although
android.content.pm.LabeledIntent is found in the bad log.

Not sure if any of this any help. Will keep plodding with it.

Dominic

Jean-Baptiste Queru

unread,
May 2, 2011, 11:15:19 AM5/2/11
to android-...@googlegroups.com
Good catch on the public doc. My teammates and I very much appreciate
the effort you're putting in trying to figure out what's going wrong
here.

JBQ

Dominic Binks

unread,
May 27, 2011, 12:45:27 PM5/27/11
to android-...@googlegroups.com
I have found the cause of this issue and am currently testing a fix. My
tests show that this issue shows up within around 200 builds. Once I
get to 500 back to back builds, we will soak the change more widely to
validate it and then I will upload for review.

Dominic

Dominic Binks

unread,
Jun 7, 2011, 11:52:49 AM6/7/11
to android-...@googlegroups.com
On 5/2/2011 8:15 AM, Jean-Baptiste Queru wrote:
> Good catch on the public doc. My teammates and I very much appreciate
> the effort you're putting in trying to figure out what's going wrong
> here.
>
> JBQ
>

Hi JBQ,

I've uploaded this change:
https://review.source.android.com/#change,23549 to address the
occasional Intent build failure problem.

A few notes about the fix.

Basically the problem is that occasionally mText.indexOf("@hide) >= 0 ||
mText.indexOf("@pending") >= 0 evaluates to true when neither @hide or
@pending are in mText (as is the case with Intent). I've not tried to
go any further into understanding why as I believe this will get into
the implementation of the JVM: there's nothing apparently broken in the
indexOf code in JDK (and it works most of the time). Sorry my knowledge
of Java is just not good enough to tackle that problem.

What I've done, and I anticipate there maybe some push back on this, is
to implement a new method isFoundIn which provides precisely the
functionality needed by droiddoc - indexOf is a richer method that
provides other functionality through different type signatures and so
the code is more complex.

This code has proved to be stable and has nearly 900 back to back builds
without fail on one tree and 850 on another. Typically I was seeing
around 100-200 builds and then a failure.

I've left the original code commented out and provided an explanation in
the code why I've modified it in the way that I have.

I'm open to comments and suggestions on how to make this patch better.

Dominic

Reply all
Reply to author
Forward
0 new messages