Bug 355552 - compiler: fails with "The type package-info is already defined"
Summary: compiler: fails with "The type package-info is already defined"
Status: VERIFIED DUPLICATE of bug 354536
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.8 M2   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-23 14:23 EDT by Martin von Zweigbergk CLA
Modified: 2011-09-13 11:46 EDT (History)
2 users (show)

See Also:


Attachments
Maven project to reproduce problem (1.47 KB, application/x-zip-compressed)
2011-08-23 14:24 EDT, Martin von Zweigbergk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Zweigbergk CLA 2011-08-23 14:23:24 EDT
Build Identifier: ecj-3.8M1

The attached project fails to build. It fails with "The type package-info is already defined". I think it depends on the order that the files are listed, so you may have to try re-creating the files a few times until A.java gets listed before package-info.java.

The problem seems to be related to what Jay describes on https://bugs.eclipse.org/bugs/show_bug.cgi?id=322789#c17. When checking if the inner class "demo.A.B" is deprecated, it is checked if the package "demo" is deprecated. This involves a call to INameEnvironment.findType(), which the maven plugin answers with an ICompilationUnit.

It is unclear to me why findType() is only called when checking nested classes. If the INameEnvironment.findType() is in fact supposed to return null, it is unclear in which cases. Only for package-info that is already in the list of compilation units?

Reproducible: Always

Steps to Reproduce:
1. Extract the attached archive
2. Run "mvn clean install"
Comment 1 Martin von Zweigbergk CLA 2011-08-23 14:24:24 EDT
Created attachment 202025 [details]
Maven project to reproduce problem
Comment 2 Olivier Thomann CLA 2011-08-23 16:12:27 EDT
This might actually be fixed with the fix for bug 354536. Do you have a way to try today's I-build ?
Comment 3 Martin von Zweigbergk CLA 2011-08-23 21:53:50 EDT
Problem solved in ecj-N20110822-2000. Thanks! Sorry about the duplicate bug report.
Comment 4 Srikanth Sankaran CLA 2011-08-24 01:02:03 EDT
 Same as 354536

*** This bug has been marked as a duplicate of bug 354536 ***
Comment 5 Olivier Thomann CLA 2011-09-13 11:46:43 EDT
Verified for 3.8M2.