Bug 42745 - spurious Xlint warning
Summary: spurious Xlint warning
Status: RESOLVED INVALID
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.1.0   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-09 00:17 EDT by Ron Bodkin CLA
Modified: 2003-09-09 13:20 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2003-09-09 00:17:58 EDT
1.1.0 and 1.1 cvs head (9/8) compiler output:

C:\eclipse\workspace\atrack>ajc -d debug @narrow.lst
C:\eclipse\workspace\atrack\src\org\atrack\model\error\impl\Softener.java:13 no
match for this type name: NoSoftener [Xlint:invalidAbsoluteTypeName]

1 warning

This bug affects 1.0.6 with the -Xlint option too...
---

import java.lang.reflect.Constructor;

/*
 * Created on Sep 8, 2003
 *
 * Copyright (c) 2003 New Aspects of Security. All Rights Reserved.
 */

/**
 * @author Ron Bodkin
 *
 */
public class NoSoftener {
    public void foo(Class clazz) {
        Class[] keyArgType = {};
        Constructor ctor = clazz.getConstructor(keyArgType);
    }
}
    
/*
 * Created on Sep 8, 2003
 *
 * Copyright (c) 2003 New Aspects of Security. All Rights Reserved.
 */
package org.atrack.model.error.impl;

/**
 * @author Ron Bodkin
 *
 */
public aspect Softener {
    pointcut callsThrowingChecked(): call(* *(..) /*throws Exception+*/) && 
within(NoSoftener);
    declare soft: Exception+: callsThrowingChecked();
}
Comment 1 Ron Bodkin CLA 2003-09-09 13:11:16 EDT
Contributing the source per CPL:

/**
 * @author Ron Bodkin
 */
public class NoSoftener {
    public void foo(Class clazz) {
        Class[] keyArgType = {};
        Constructor ctor = clazz.getConstructor(keyArgType);
    }
}
    
package org.atrack.model.error.impl;

/**
 * @author Ron Bodkin
 */
public aspect Softener {
    pointcut callsThrowingChecked(): call(* *(..) /*throws Exception+*/) && 
within(NoSoftener);
    declare soft: Exception+: callsThrowingChecked();
}
Comment 2 Jim Hugunin CLA 2003-09-09 13:20:22 EDT
This is not a bug, but the correct implementation of type name resolution
according to the JLS and implemented in all compliant Java compilers (first
implemented in jdk 1.4.0).  There is no way to refer to types in the default
package from a named package.  Go ahead and try this without any aspects using
the jdk1.4 or later compiler and you'll see the same behavior.