Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ajdt-dev] Problem with German umlauts in case-tags (AspectJ 1.6.3)

Andrew Eisenberg schrieb:
Well, after looking into this a bit more, there was a problem with the
AJDT editor parser in that it didn't handle the default: label of a
switch statement in AJ files.  Fixed that and I am able to properly
compile your sample.  I created this aspect in an aspectj project.
Does this not compile for you?

I've tried the following:

- Commenting out the default: Same error.
- Commenting out the whole switch-statement: Same error.


I expect that you should see an error on the line that has the default
label (this will be fixed).  But, do you see any other errors?  If
not, can you send over the code that is not working for you?

The problem is that i can't see any error on a special line. In eclipse i start a 'clean' for the project. A Dialog opens, showing lots of files beeing compiled. After some time another dialog opens, giving me the error "An internal error occurred during: "Delete and update AspectJ markers for <project-name>". Afterwards i can find the stacktrace from my first post in the eclipse errors-pane. The same project compiles without any problem if i compile it as an ant task from eclipse. The only difference i can see is eclipse using the aspectjrt.jar from the aspectj-plugin and the ant task using the aspectjrt.jar from the project - but both are release 1.6.3

Sending the code will be a bit problematic, i will try to create a minimal sample project, but this can take some time.




public aspect TestNonAsciiFail {
	
	void doNothing2() {
        StringBuffer sb = new StringBuffer(100);
        String in = "";
        for (int i = 0;  i < in.length();  i++) {
                int c = in.charAt(i);
                switch (c) {
                case 'ä':
                        sb.append("(4a)");
                        break;
                case 'ö':
                        sb.append("(b6)");
                        break;
                case 'ü':
                        sb.append("(bc)");
                        break;
                case 'Ä':
                        sb.append("(84)");
                        break;
                case 'Ö':
                        sb.append("(96)");
                        break;
                case 'Ü':
                        sb.append("(9c)");
                        break;
                case 'ß':
                        sb.append("(9f)");
                        break;
                default:
                        sb.append((char)c);
                }
        }
	}
}


On Tue, Jan 13, 2009 at 10:50 AM, Dirk Lachowski
<dirk.lachowski@xxxxxxxxx> wrote:
Hi list,

i've run over some problems when using german umlauts in a case tag.
Using this code-snippet:

               StringBuffer sb = new StringBuffer(100);
               for (int i = 0;  i < in.length();  i++) {
                       int c = in.charAt(i);
                       switch (c) {
                       case 'ä':
                               sb.append("(4a)");
                               break;
                       case 'ö':
                               sb.append("(b6)");
                               break;
                       case 'ü':
                               sb.append("(bc)");
                               break;
                       case 'Ä':
                               sb.append("(84)");
                               break;
                       case 'Ö':
                               sb.append("(96)");
                               break;
                       case 'Ü':
                               sb.append("(9c)");
                               break;
                       case 'ß':
                               sb.append("(9f)");
                               break;
                       default:
                               sb.append((char)c);
                       }

i get this error:

[iajc] info compiling
/opt/hudson/jobs/es3/workspace/es3/src/net/lacho/r2/b2bweb/util/StringUtil.java
    [iajc] error at case '?':
    [iajc] ^^^^
    [iajc]
/opt/hudson/jobs/es3/workspace/es3/src/net/lacho/r2/b2bweb/util/StringUtil.java:10:0::0



Duplicate case
    [iajc] error at case '?':
    [iajc] ^^^^
    [iajc]
/opt/hudson/jobs/es3/workspace/es3/src/net/lacho/r2/b2bweb/util/StringUtil.java:13:0::0



Duplicate case
    [iajc] error at case '?':
    [iajc] ^^^^
    [iajc]
/opt/hudson/jobs/es3/workspace/es3/src/net/lacho/r2/b2bweb/util/StringUtil.java:16:0::0



Duplicate case
    [iajc] error at case '?':
    [iajc] ^^^^
    [iajc]
/opt/hudson/jobs/es3/workspace/es3/src/net/lacho/r2/b2bweb/util/StringUtil.java:19:0::0



Duplicate case
    [iajc] error at case '?':
    [iajc] ^^^^
    [iajc]
/opt/hudson/jobs/es3/workspace/es3/src/net/lacho/r2/b2bweb/util/StringUtil.java:22:0::0



Duplicate case
    [iajc] error at case '?':
    [iajc] ^^^^
    [iajc]
/opt/hudson/jobs/es3/workspace/es3/src/net/lacho/r2/b2bweb/util/StringUtil.java:25:0::0



Duplicate case
    [iajc] error at case '?':
    [iajc] ^^^^
    [iajc]
/opt/hudson/jobs/es3/workspace/es3/src/net/lacho/r2/b2bweb/util/StringUtil.java:28:0::0



Duplicate case
    [iajc] info Compiler took 4670ms
    [iajc] MessageHolder:  (776 info)  (1 warning)  (7 error)


If i change the cases to something like

                       switch (c) {
                       //case 'ä':
                       case '\u00e4':
                               sb.append("(4a)");
                               break;
the code compiles.

To make it even more odd, if i compile my project in eclipe (with the
modified unicode-tags), i get the following error:

An internal error occurred during: "Delete and update AspectJ markers
for HEAD".

with this stacktrace:

java.lang.NumberFormatException: For input string:
"2~processRow~QResultSet;["
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.<init>(Unknown Source)
at
org.aspectj.asm.internal.JDTLikeHandleProvider.getCount(JDTLikeHandleProvider.java:207)
at
org.aspectj.asm.internal.JDTLikeHandleProvider.createHandleIdentifier(JDTLikeHandleProvider.java:118)
at
org.aspectj.asm.internal.ProgramElement.getHandleIdentifier(ProgramElement.java:555)
at
org.aspectj.asm.internal.ProgramElement.getHandleIdentifier(ProgramElement.java:547)
at org.aspectj.asm.internal.RelationshipMap.get(RelationshipMap.java:63)
at
org.eclipse.ajdt.core.model.AJProjectModelFacade$2.preProcess(AJProjectModelFacade.java:691)
at org.aspectj.asm.HierarchyWalker.process(HierarchyWalker.java:28)
at org.aspectj.asm.internal.ProgramElement.walk(ProgramElement.java:420)
at org.aspectj.asm.HierarchyWalker.process(HierarchyWalker.java:29)
at org.aspectj.asm.internal.ProgramElement.walk(ProgramElement.java:420)
at org.aspectj.asm.HierarchyWalker.process(HierarchyWalker.java:29)
at org.aspectj.asm.internal.ProgramElement.walk(ProgramElement.java:420)
at org.aspectj.asm.HierarchyWalker.process(HierarchyWalker.java:29)
at org.aspectj.asm.internal.ProgramElement.walk(ProgramElement.java:420)
at org.aspectj.asm.HierarchyWalker.process(HierarchyWalker.java:29)
at org.aspectj.asm.internal.ProgramElement.walk(ProgramElement.java:420)
at
org.eclipse.ajdt.core.model.AJProjectModelFacade.getRelationshipsForFile(AJProjectModelFacade.java:689)
at
org.eclipse.ajdt.internal.ui.markers.UpdateAJMarkers.addMarkersForFile(UpdateAJMarkers.java:170)
at
org.eclipse.ajdt.internal.ui.markers.UpdateAJMarkers.addMarkersForProject(UpdateAJMarkers.java:127)
at
org.eclipse.ajdt.internal.ui.markers.UpdateAJMarkers.run(UpdateAJMarkers.java:94)
at
org.eclipse.ajdt.internal.ui.markers.DeleteAndUpdateAJMarkersJob.run(DeleteAndUpdateAJMarkersJob.java:62)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


I'm not sure if the two are related because the second error (the one in
eclipse) gives no hint in which file the error occurs. I suppose it's
when weaving aspects from an external jar, but the same jar and the same
code compiles in an ant-task without any problem.

Any hint where i could investigate further?


Cheers

Dirk


-------------------------------------
Lachowski Datensysteme GmbH
Strassburger Platz 25
D-30853 Langenhagen

Fon: +49 511 725353-71
Fax: +49 511 725353-89

Sitz der Gesellschaft: 30853 Langenhagen
Registergericht: Amtsgericht Hannover, HRB 120580
Geschäftsführer: Dirk Lachowski




_______________________________________________
ajdt-dev mailing list
ajdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ajdt-dev

_______________________________________________
ajdt-dev mailing list
ajdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ajdt-dev




Back to the top