Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348024

Summary: Empty AST for class with static inner class in a package with package-info.java
Product: [Eclipse Project] JDT Reporter: Xavier Coulon <xcoulon>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: amj87.iitr, clappi, daniel_megert, donksr1, eclipse.sprigogin, eclipse, jarthana, jwnimmer, markus.kell.r, michael.koch, michael, mlippert, nahid.akbar, Olivier_Thomann, philippe.marschall, srikanth_sankaran, stephan.herrmann, tball, tparker, vyazelenko
Version: 3.7Flags: srikanth_sankaran: review+
stephan.herrmann: review+
Target Milestone: 3.7.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Test case Eclipse project for bug 348024
none
Proposed fix + regression test none

Description Xavier Coulon CLA 2011-06-01 17:39:25 EDT
Build Identifier: I20110519-1138

I have the following class with a private constructor and an internal builder class that invokes this constructor.

public class TestClass {

	private String testField;

	public static class TestBuilder {

		private String t;

		public TestClass build() {
			return new TestClass(this);
		}

	}

	private TestClass(TestBuilder builder) {
		this.testField = builder.t;
	}

}

When I try to pugenerate getters and setters for the 'testField' attribute, it fails with the following errors:

java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:477)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2642)
	at org.eclipse.ui.internal.progress.ProgressManager$RunnableWithStatus.run(ProgressManager.java:1346)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.progress.ProgressManager$7.run(ProgressManager.java:1184)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4681)
	at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1182)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:618)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.generate(AddGetterSetterAction.java:549)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:340)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:575)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:279)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4163)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.dom.ASTNodes.getParent(ASTNodes.java:514)
	at org.eclipse.jdt.internal.corext.codemanipulation.AddGetterSetterOperation.run(AddGetterSetterOperation.java:307)
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4860)
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	... 46 more



and



Java Model Exception: Core Exception [code 4] Could not find the selected type element
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:50)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4860)
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2642)
	at org.eclipse.ui.internal.progress.ProgressManager$RunnableWithStatus.run(ProgressManager.java:1346)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.progress.ProgressManager$7.run(ProgressManager.java:1184)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4681)
	at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1182)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:618)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.generate(AddGetterSetterAction.java:549)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:340)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:575)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:279)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4163)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: org.eclipse.core.runtime.CoreException: Could not find the selected type element
	at org.eclipse.jdt.internal.corext.codemanipulation.AddGetterSetterOperation.run(AddGetterSetterOperation.java:312)
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4860)
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2642)
	at org.eclipse.ui.internal.progress.ProgressManager$RunnableWithStatus.run(ProgressManager.java:1346)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.progress.ProgressManager$7.run(ProgressManager.java:1184)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4681)
	at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1182)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:618)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.generate(AddGetterSetterAction.java:549)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:340)
	at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run(AddGetterSetterAction.java:575)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:279)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4163)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

Reproducible: Always

Steps to Reproduce:
1. Use a sample class
2.
3.
Comment 1 Xavier Coulon CLA 2011-06-01 17:40:30 EDT
[Sorry, I submitted the issue a bit too fast]
-> Steps to reproduce : use the sample code provided in the initial comment.
Comment 2 Olivier Thomann CLA 2011-06-01 21:18:10 EDT
I'll take a look at it.
Comment 3 Olivier Thomann CLA 2011-06-02 11:13:05 EDT
I could not reproduce using I20110529-2200 (4.1 build).
Could you please pack up a project with project's specific settings and attach it to this bug report ?
Comment 4 Olivier Thomann CLA 2011-06-08 14:08:01 EDT
Xavier, could you reproduce on Indigo RC4 ? If yes, please provide your project as I cannot reproduce following steps in comment 0.
Comment 5 Olivier Thomann CLA 2011-06-24 12:39:15 EDT
Moving to JDT/UI
Comment 6 Missing name CLA 2011-06-29 14:33:05 EDT
I get the same error using the refactor to rename a constructor argument name of a inner class.
Comment 7 Olivier Thomann CLA 2011-06-29 14:42:21 EDT
(In reply to comment #6)
> I get the same error using the refactor to rename a constructor argument name
> of a inner class.
Would it be possible for you to attach a test case ?
Comment 8 Dani Megert CLA 2011-07-05 02:43:58 EDT
*** Bug 350523 has been marked as a duplicate of this bug. ***
Comment 9 Dani Megert CLA 2011-07-05 02:44:07 EDT
*** Bug 350413 has been marked as a duplicate of this bug. ***
Comment 10 Michael Koch CLA 2011-07-05 03:01:21 EDT
Created attachment 199088 [details]
Test case Eclipse project for bug 348024

The attached zipped Eclipse project is a test case for this bug. Note that as in bug 350523 I can only reproduce the error if there is a package-info.java in the same package as the test class.
Comment 11 Dani Megert CLA 2011-07-21 02:31:13 EDT
*** Bug 351915 has been marked as a duplicate of this bug. ***
Comment 12 Dani Megert CLA 2011-08-03 02:17:14 EDT
*** Bug 353687 has been marked as a duplicate of this bug. ***
Comment 13 LINEMAN78 CLA 2011-08-11 18:27:22 EDT
I can confirm that I ran into this same issue with classes with static internal classes and package level annotations.  This broke both the JPA plugin and getter/setter generation.
Comment 14 Nahid Akbar CLA 2011-08-15 00:05:54 EDT
works fine on heilos
Comment 15 Markus Keller CLA 2011-08-23 11:44:34 EDT
This is a bug in JDT Core. The ASTParser returns an empty AST as soon as there's a package-info.java file.

To reproduce, import the project from comment 10 and then e.g. use the ASTView in "Use ASTParser.createASTs" mode.
Comment 16 Olivier Thomann CLA 2011-08-23 11:48:30 EDT
I'll take a look. This is severe.
Comment 17 Olivier Thomann CLA 2011-08-23 12:16:36 EDT
Seems to be fixed in HEAD. Investigating.
Comment 18 Olivier Thomann CLA 2011-08-23 12:32:19 EDT
The fix for bug 354536 is fixing this one as well.
Comment 19 Markus Keller CLA 2011-08-23 12:39:47 EDT
> use the ASTView in "Use ASTParser.createASTs" mode.
-----> It's actually "Use ASTParser.createAST".

Yup, fixed in HEAD, but broken in R3_7_maintenance. Bug 354536 fixes the problem, but I'd like to understand why.
Comment 20 Olivier Thomann CLA 2011-08-23 13:31:07 EDT
Inside the 
org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitDeclaration, ICompilationUnit, NodeSearcher, boolean, boolean, boolean)
there is no loop as it was done for other paths to retrieve the right unit after the call to beginToCompile(..).
Check the fix for bug 337868.

I think the same patch that was done for bug 337868 should also be done in this case.
So instead of applying patch for bug 354536 I prefer to be more consistent and apply the same loop done for the fix for bug 337868.

Patch to follow.
Comment 21 Olivier Thomann CLA 2011-08-23 13:47:53 EDT
Created attachment 202021 [details]
Proposed fix + regression test
Comment 22 Olivier Thomann CLA 2011-08-23 13:48:13 EDT
Srikanth, please review.
Comment 23 Olivier Thomann CLA 2011-08-23 13:49:06 EDT
Stephan, please review as this is similar to the fix you made for bug 337868. I think one path was missing.
Comment 24 Stephan Herrmann CLA 2011-08-23 15:45:01 EDT
First, here's my analysis:

I agree on the similarity to bug 337868, in both cases the code was
based on the brittle assumption that beginToCompile would insert
exactly one CUD into unitsToProcess. This is dangerous.

At a closer look the design seems to be: during beginToCompile no
further types must be requested from the LookupEnvironment.
If the compiler follows that rule, the above assumption should be sound.

So far we know of exactly one violation of the rule: the lookup of
package-info.java triggered along the path that was removed in bug 354536.
If this was indeed the only trigger, the patch from bug 354536 should be
the superior solution. Otherwise the following fact can still strike back
on us: if during beginToCompile a further type is requested and 
accepted() that type will actually get ahead of the initial type,
because it will be process up-to and including completeTypeBindings(),
before the initial type even completes beginToCompile().
I.e. the additional loop proposed here (a la bug 337868) doesn't
guarantee the intended processing order.
I couldn't easily find a test case to demonstrate possible havoc,
but I feel we are on unsafe grounds as long as we accept such unintended
orders.

For 3.8 I suggest to combine both approaches and additionally add checks
that will report/log whenever we see more than one unitsToProcess at the
locations is question.

For 3.7.1 I'm not quite sure which way is safest. Either patch fixes the
immediate issue. I'm leaning towards suggesting both patches also for
3.7.1, to be on the safe side. Do you see any risk in the patch from
bug 354536?
Comment 25 Olivier Thomann CLA 2011-08-23 16:08:02 EDT
(In reply to comment #24)
> For 3.7.1 I'm not quite sure which way is safest. Either patch fixes the
> immediate issue. I'm leaning towards suggesting both patches also for
> 3.7.1, to be on the safe side. Do you see any risk in the patch from
> bug 354536?
I am also tempted to go with both fixes as this makes the compilation order more predictable and prevent types from being inserted into the unitToProcess array when beginToCompile(..) is called.

Srikanth, I think the patch I attached makes the code from bug 337868 more consistent. The fix for 354536 makes sure that the package-info unit is not inserted in the units to process too early.

This might fix other issues when package-info unit exists.
Comment 26 Olivier Thomann CLA 2011-08-23 16:09:10 EDT
(In reply to comment #24)
> I.e. the additional loop proposed here (a la bug 337868) doesn't
> guarantee the intended processing order.
This was not the intent. I wanted all paths to be covered the same way. Right now one path is clearly inconsistent.
Comment 27 Stephan Herrmann CLA 2011-08-23 16:21:52 EDT
(In reply to comment #26)
> (In reply to comment #24)
> > I.e. the additional loop proposed here (a la bug 337868) doesn't
> > guarantee the intended processing order.
> This was not the intent. I wanted all paths to be covered the same way. Right
> now one path is clearly inconsistent.

Fully agree. I was discussing more the global picture of underlying
design intentions :)

BTW: feeling "guilty" for the incompleteness in bug 337868 I looked
for other candidates, but there is only one third call to beginToCompile 
which is the main compile(ICompilationUnit[]) method which looks clean to me.
Comment 28 Stephan Herrmann CLA 2011-08-23 16:41:56 EDT
(In reply to comment #25)
> I am also tempted to go with both fixes 

I'll give you my +1 for this.

RC2 will be built tomorrow morning, right? 
Were you planning to contribute the patch to that build?
Comment 29 Olivier Thomann CLA 2011-08-23 17:43:35 EDT
(In reply to comment #28) 
> RC2 will be built tomorrow morning, right? 
> Were you planning to contribute the patch to that build?
Ideally.
I'll also give a +1 for the fix for bug 354536.
Comment 30 Srikanth Sankaran CLA 2011-08-24 02:14:59 EDT
Patch looks good.
(In reply to comment #25)

> I am also tempted to go with both fixes as this makes the compilation order
> more predictable and prevent types from being inserted into the unitToProcess
> array when beginToCompile(..) is called.

> Srikanth, I think the patch I attached makes the code from bug 337868 more
> consistent. The fix for 354536 makes sure that the package-info unit is not
> inserted in the units to process too early.

+1 for thew fix for bug 354536 also.
Comment 31 Srikanth Sankaran CLA 2011-08-24 02:35:47 EDT
Released in HEAD for 3.8 M2 and in 3.7.x maintenance stream for 3.7.1 RC2.
Jay, please include this for 3.7.1 RC2.
Comment 32 Olivier Thomann CLA 2011-08-24 10:50:39 EDT
*** Bug 355390 has been marked as a duplicate of this bug. ***
Comment 33 Ayushman Jain CLA 2011-08-25 09:02:45 EDT
Verified for 3.7 RC2 using build I20110824-0800.
Comment 34 Jay Arthanareeswaran CLA 2011-09-14 04:29:50 EDT
Verified for 3.8M2 with build I20110912-2126.
Comment 35 Dani Megert CLA 2011-10-17 08:54:07 EDT
*** Bug 361047 has been marked as a duplicate of this bug. ***
Comment 36 Tom Ball CLA 2011-10-17 16:41:18 EDT
*** Bug 361181 has been marked as a duplicate of this bug. ***