Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] class location question

I follow the tutorial (http://www.ibm.com/developerworks/library/j-aopwork5/) to practise design pattern. Whilst coding adaptor patterns, I encounter a problem. It is related to the path location.

The files sturcture in which code works fine looks as below:
sensor/TemperatureSensor.java
sensor/RadiationSensor.java
Test.java (where calls sensor classes)
adaptor/Adaptors.aj (adaptor pattern module)
adaptor/StatusSensor.java (sensor interface)

Everything resembles the tutorial and it works well. However, if I change the files structure to following:
TemperatureSensor.java
RadiationSensor.java
Test.java (where calls sensor classes)
adaptor/Adaptors.aj (adaptor pattern module)
adaptor/StatusSensor.java (sensor interface)

In this structure I move sensors classes to the default package (the same level as Test class)

Then when invoking ajc compiler it echos

[error] The import sensor cannot be resolved
import sensor.TemperatureSensor;
       ^^^^^
 [error] The import sensor cannot be resolved
import sensor.RadiationSensor;
       ^^^^^
 [error] TemperatureSensor cannot be resolved to a type
public String TemperatureSensor.getStatus(){
              ^^^^^^^^^^^^^^^
 [error] RadiationSensor cannot be resolved to a type
public String RadiationSensor.getStatus(){
              ^^^^^^^^^^^^^
 [error] The type TemperatureSensor must implement the inherited abstract method StatusSensor.getStatus()
public class TemperatureSensor{
             ^^^^^^^^^^^^^^^^
 [error] The type RadiationSensor must implement the inherited abstract method StatusSensor.getStatus()
public class RadiationSensor{
             ^^^^^^^^^^^^^^

What causes this error? or How should I compile the source in order to solve this error? 

Thank you very much,


      __________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html


Back to the top