This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | URLMapper.findURL(fo, NETWORK) returns file URL | ||
---|---|---|---|
Product: | ide | Reporter: | Rich Unger <richunger> |
Component: | Internal Server | Assignee: | Petr Pisl <ppisl> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | pjiricka, rkubacki, rmatous |
Priority: | P3 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
patch
MasterURLMapperTest.java |
Description
Rich Unger
2005-09-09 22:10:20 UTC
originally found in 4.1, but I've just confirmed it's still a bug in 5.0 build 200509051800 Created attachment 24713 [details]
patch
I made a patch. There are 2 problems here: The URLMapper in openide/masterfs (MasterURLMapper) never checks the URL type argument, so it will return a file URL, despite the fact that a NETWORK url was requested. The HttpServerURLMapper contains a puzzling line, with the comment: "if the file is on the localhost, don't return URL with HTTP" This seems to me to be incorrect. This mapper returns immediately if the type is not NETWORK. So, it should only be concerned with return http URLs, whether or not the file is on localhost. Of course, the string "localhost" should be replaced by the host name (which it is, at least in my testing). So, I just removed that line, and it worked fine. Martin, please can you evaluate this? Looking at the CVS log, I see that the controversial line was put in to fix issue 39072 (by Petr Pisl), so we have to be careful here. Petre, can you please evaluate? Radku, can you please look at the MasterFS part of this? Thanks. BTW, unit tests would be useful. Issue 39072 seems to ignore the semantic that if the client asks for type=NETWORK, they want an http URL. Agreed, file: should not be returned for NETWORK. It is fine for EXTERNAL. (Whether http://localhost:8082/etc is acceptable for NETWORK is another question, but we cannot control what the local host name is set to.) I agree with MasterFS part of the patch. I agree with the patch. And I also agree with Petr Jiricka, that unit tests would be useful. Created attachment 25031 [details]
MasterURLMapperTest.java
I'd feel a lot better if we could target this for 5.0. I really need it for V-Builder, and it just needs to be checked in! Seems like everybody agrees on a fix, so is anyone going to commit the patch into cvs? I checked in the httpserver portion. I do not have access to MasterFS. /cvs/openide/masterfs/src/org/netbeans/modules/masterfs/MasterURLMapper.java,v<-- new revision: 1.12; previous revision: 1.11 /cvs/openide/masterfs/test/unit/src/org/netbeans/modules/masterfs/MasterURLMapperTest.java,v initial revision: 1.1 TM 5.0 -> TBD TBD? Can we set this for the next release please?! I made the patch in plenty of time for 5.0, there was no dissent, I checked in the half that I had access to in CVS. What's the holdup here? It's a very simple fix, and without the fix the documented API's assumptions are violated. The code was already rewriten. So it should work. I tried it on release55 branch. I close the issue as fixed. Feel free to reopen the issue, if it doesn't work for you. |