| Summary: | Workspace compile errors in HEAD | ||
|---|---|---|---|
| Product: | [WebTools] WTP Common Tools | Reporter: | Rob Stryker <stryker> |
| Component: | Faceted Project Framework | Assignee: | Konstantin Komissarchik <konstantin> |
| Status: | RESOLVED FIXED | QA Contact: | Konstantin Komissarchik <konstantin> |
| Severity: | normal | ||
| Priority: | P3 | CC: | ccc, konstantin |
| Version: | unspecified | ||
| Target Milestone: | 3.3 M5 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 335073, 335074, 335075 | ||
|
Description
Rob Stryker
> though we haven't figured out why they show up as errors in my workspace
> and not his.
Did you change java validation preferences in your workspace? A lot of these are warning/ignore by default. Many are code style issues that are subjective, like this one:
line 332 Java Problem
The field WebServicesNavigatorContentProvider.viewer is hiding a field from
type AdapterFactoryContentProvider WebServicesNavigatorContentProvider.java
/org.eclipse.jst.j2ee.webservice.ui/webservices_ui/org/eclipse/jst/j2ee/internal/webservice
I replaced my cvs tree with what was in HEAD and imported it into a brand new eclipse build (wtp3.3m4) with a brand new workspace ;) For the example you cited, you can see in hte org.eclipse.jst.j2ee.webservice.ui/.settings/org.eclipse.jdt.core.prefs file that these *are* marked as errors. Right-clicking on the project clearly says it should use project-specific preferences and those preferences indicate errors. So... either the validation preferences inside these projects need to downgrade some of their validation prefs to warnings, or we need to fix the coding "errors" =] Konstantin, please use this bug to handle the Unnecessary cast from String to String BundleReference.java /org.eclipse.jst.common.project.facet.core/src/org/eclipse/jst/common/project/facet/core/libprov/osgi line 92 Java Problem (I've seen that error since I first set up a WTP 3.3 dev env.) I will clone this bug to handle the other problems. Also to note: NONE OF THE org.eclipse.wst.common.explorer ERRORS WILL BE FIXED. That plugin was never shipped as part of WTP, and should not be part of any dev env. > Unnecessary cast from String to String BundleReference.java
> /org.eclipse.jst.common.project.facet.core/src/org/eclipse/jst/common/project
> /facet/core/libprov/osgi
> line 92 Java Problem
I don't know why or how you go this, but this an invalid problem. The line in question is this:
final String versionString = (String) bundle.getHeaders().get( "Bundle-Version" ); //$NON-NLS-1$
Where "bundle" is OSGi Bundle class. The getHeaders() method of that class returns unparameterized Dictionary class. It is declared as follows:
public Dictionary/* <String,String> */getHeaders();
The cast is necessary.
The evaluation was done using Indigo M4 in dev eclipse and target platform.
(In reply to comment #4) > > Unnecessary cast from String to String BundleReference.java > > /org.eclipse.jst.common.project.facet.core/src/org/eclipse/jst/common/project > > /facet/core/libprov/osgi > > line 92 Java Problem > > I don't know why or how you go this, but this an invalid problem. The line in > question is this: > > final String versionString = (String) bundle.getHeaders().get( "Bundle-Version" > ); //$NON-NLS-1$ > > Where "bundle" is OSGi Bundle class. The getHeaders() method of that class > returns unparameterized Dictionary class. It is declared as follows: > > public Dictionary/* <String,String> */getHeaders(); > > The cast is necessary. > > The evaluation was done using Indigo M4 in dev eclipse and target platform. Konstantin, In my Helios environment, I see the public Dictionary/* <String,String> */getHeaders(); In my Indigo environment, I do not see the comments in the public Dictionary <String,String> getHeaders(); I have both Indigo M4 for my dev and target platform. The class Bundle comes from org.eclipse.osgi_3.7.0.v20101207.jar. Please see bug 322007 for details on this change (which was committed to Bundle on August 6, 2010). The cast is unnecessary, and shows up as an error in development environments. (But not during our WTP builds, for some reason.) Ok, I had a problem with my target platform, which prevented this problem from showing for me...
> The cast is unnecessary, and shows up as an error in development environments.
> (But not during our WTP builds, for some reason.)
Well it is and it isn't necessary. If I remove the cast, the code instantly becomes incompatible with Helios. The code is currently compatible with both Helios and Indigo. Now, I know that we don't test for or advertise compatibility of 3.3 with Helios, but I don't remember seeing any statements about this explicitly not being a requirement. I do remember debates about this during past releases.
Instead of removing the cast, I changed the project's compiler properties to flag unnecessary casts as warnings instead of errors.
|