|
next
|
Subject: Somewhat unexpected behavior with respect to projects, classpath, and files Author: David Karr Date: 15 Nov 2005 07:09 PM
|
I don't know exactly how I would expect this to work, but I noticed some
unexpected behavior when running an xslt that uses an extension
function, when I had it in a project that has a specific classpath set,
and the global classpath is unset (except for "${classpath}").
When I opened up StylusStudio, it opened up the last file I was looking
at (apparently), but the project that it opened up was not the project
this file is in. I then clicked on the "Preview" button, and it got a
MethodNotFoundException, which confused me, as this had been working
earlier in the day. I realized that I had recently been fiddling with
putting files into projects, and setting the classpath for the project,
and leaving the global classpath empty.
What I noticed is that if I then clicked on the project this file is in,
and then clicked the Preview button, it worked.
From this, I don't know what I would suggest to make this work better.
It might be worth changing the startup sequence so that if the last
opened file is not in the last opened project, it might try to find the
most-recently opened project that contains this file (I'm guessing files
can be in more than one project).
Alternatively, perhaps if SS detects that the file is in a project that
has a project-specific classpath, and that project is not the current
project, it could desensitize the Debug and Preview buttons, with a
tooltip pointing out the issue.
Perhaps a dialog with a Java exception could print "Are you in the wrong
project?" if the project the file is in (you'd have to figure out which
project(s) the file is in) has a project-specific classpath.
None of these are really great ideas. The easiest answer might be to
just ignore me :) .
|
top
|
Subject: Somewhat unexpected behavior with respect to projects, classpath, and files Author: (Deleted User) Date: 16 Nov 2005 05:30 PM
|
David, the easiest answer is rarely the best answer. :)
But, generally, we agree with you: it is hard to know exactly how to address the problem.
Another related problem: If there are two copies of the .class file in the project classpath, and the wrong one comes first, then no matter how many times you recompile your .java file, it still won't work right.
Anyway, as you said, a file can be in more than one project, so there is no concept of a file's project.
- clyde
|
|
|