Summary: | Wrong MethodDeclaration in AST tree | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Steven Decock <kletskeunsafe> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | kletskeunsafe |
Version: | 3.2.1 | ||
Target Milestone: | 3.3 M7 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Steven Decock
2007-04-17 12:49:03 EDT
With your code, the file is not completely read. If you change the for loop with: while ((numRead = reader.read(chars)) > -1) { sb.append(chars, 0, numRead); } it should work better. Another point, resolveBindings(true) doesn't work if you don't set a java project. This is explained in the javadoc of the ASTParser class. Closing as INVALID. Reopening for further investigation. Even if the source is incorrect, it looks boggus to try to retrieve method header inside comments. With your way to read the source you actually end up with this source: package com.me.test; public class KAdresse { /** * This is not a method, really, I'm telling you: notAMethod (one, two, ...) */ private String tAdresOngebSit; /** * Gemeentenaam. * Zit normaal in KCodeNisCommune, dit veld dient voor de bestaande gevallen waar in de migratie de link naar de gemeentetabel niet kan gelegd worden. * Dit veld bevat dan de huidige gemeentenaam. * [JFC] conserver la meme regle. Attention, la migration devrait ne plus permettre d'anciens noms de communes ou des noms non valides. Ici sert à la migration mais non utilisé pour la recherche. */ private String tAdresNisComNom; /** * Référence vers la tables des codes de rue * @clientCardinality 0..* * @supplierCardinality 1 * @label référence à */ private KCodeRue lnkKCodeRue; /** * Référence vers la table des codes NIS de commune * @clientCardinality 0..* * @supplierCardinality 0..1 * @label référence à */ private KCodeNisCommune lnkKCodeNisCommune; }is not a method, really, I'm telling you: notAMethod (one, two, ...) */ private String tAdresOngebSit; /** * Gemeentenaam. * Zit normaal in KCodeNisCommune, dit veld dient voor de bestaande gevallen waar in de migratie de link naar de gemeentetabel niet kan gelegd worden. * Dit veld bevat dan de huidige gemeentenaam. * [JFC] conserver la meme regle. Attention, la migration devrait ne plus permettre d'anciens noms de communes ou des noms non valides. Ici sert à la migration mais non utilisé pour la recherche. */ private String tAdresNisComNom; /** * Référence vers la tables des codes de rue * @clientCardinality 0..* * @supplierCardinality 1 * @label référence à */ private KCodeRue lnkKCodeRue; /** * Référence vers la table des codes NIS de commune * @clientCardinality 0..* * @supplierCardinality 0..1 * @label And if you look at the code below the field lnkKCodeNisCommune, you can see that you also have notAMethod. This is where the method is coming from at the end. private KCodeNisCommune lnkKCodeNisCommune; }is not a method, really, I'm telling you: notAMethod (one, two, ...) So I won't make any changes for this. The recovery mechanism is not looking inside comments, but the given code is so busted, that the compiler tries to infer malformed methods and fields out of the given source. Closing as INVALID. If you believe we are wrong, please reopen and explain what you expect. Verify for 3.3M7 with I20070503-1400. |