From e390c09b6e313b7d9528ca9075e2c5c864c05f21 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 10 Apr 2002 08:35:01 +0000 Subject: [PATCH] Really move the generated java files in rmic. PR: 5781 Fixed some minor stuff in DefaultRmicAdapter while I was at it. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272331 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/taskdefs/MatchingTask.java | 2 +- .../org/apache/tools/ant/taskdefs/Rmic.java | 15 +++++++++++++- .../ant/taskdefs/rmic/DefaultRmicAdapter.java | 20 ++++++++++++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java b/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java index 0b7653fe8..6b525cde5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/main/org/apache/tools/ant/taskdefs/Rmic.java b/src/main/org/apache/tools/ant/taskdefs/Rmic.java index f8f590251..197f593e9 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Rmic.java +++ b/src/main/org/apache/tools/ant/taskdefs/Rmic.java @@ -440,9 +440,22 @@ public class Rmic extends MatchingTask { adapter.getMapper().mapFileName(classFileName); for (int i=0; i + *
  • for JRMP it will return *_Stub (and *_Skel if JDK 1.1 is + * used)
  • + * + *
  • for IDL it will return a random name, causing to + * always recompile.
  • + * + *
  • for IIOP it will return _*_Stub for interfaces and _*_Tie + * for non-interfaces (and determine the interface and create + * _*_Stub from that).

    + * */ private class RmicFileNameMapper implements FileNameMapper { @@ -288,7 +300,9 @@ public abstract class DefaultRmicAdapter implements RmicAdapter { return null; } - String base = name.substring(0, name.indexOf(".class")); + // we know that name.endsWith(".class") + String base = name.substring(0, name.length()-6); + String classname = base.replace(File.separatorChar, '.'); if (attributes.getVerify() && !attributes.isValidRmiRemote(classname)) {