summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2018-02-01 10:42:02 -0800
committerMark Spruiell <mes@zeroc.com>2018-02-01 10:42:02 -0800
commita34dfc0906d5e3b09b5dc333e1e1d373b850a314 (patch)
treec63751eb56112774df48956c08c7d7eac40e7f12
parentAdded ice_fixed to generated Java proxy class, added test to check proxy retu... (diff)
downloadice-a34dfc0906d5e3b09b5dc333e1e1d373b850a314.tar.bz2
ice-a34dfc0906d5e3b09b5dc333e1e1d373b850a314.tar.xz
ice-a34dfc0906d5e3b09b5dc333e1e1d373b850a314.zip
ICE-8544 - Updates to packaging metadata
-rw-r--r--CHANGELOG-3.7.md26
-rw-r--r--cpp/src/Slice/JavaUtil.cpp119
-rw-r--r--cpp/src/Slice/JavaUtil.h6
-rw-r--r--cpp/src/Slice/PythonUtil.cpp71
-rw-r--r--cpp/src/Slice/PythonUtil.h2
-rw-r--r--java-compat/test/src/main/java/test/Ice/packagemd/AllTests.java14
-rw-r--r--java-compat/test/src/main/java/test/Ice/packagemd/InitialI.java18
-rw-r--r--java-compat/test/src/main/java/test/Ice/packagemd/Package.ice2
-rw-r--r--java-compat/test/src/main/java/test/Slice/generation/File1.ice11
-rw-r--r--java-compat/test/src/main/java/test/Slice/generation/list-generated.out6
-rw-r--r--java/test/src/main/java/test/Ice/packagemd/AllTests.java14
-rw-r--r--java/test/src/main/java/test/Ice/packagemd/InitialI.java18
-rw-r--r--java/test/src/main/java/test/Ice/packagemd/Package.ice2
-rw-r--r--java/test/src/main/java/test/Slice/generation/File1.ice11
-rw-r--r--java/test/src/main/java/test/Slice/generation/list-generated.out2
-rw-r--r--python/test/Ice/packagemd/AllTests.py10
-rw-r--r--python/test/Ice/packagemd/Package.ice1
-rwxr-xr-xpython/test/Ice/packagemd/Server.py12
18 files changed, 257 insertions, 88 deletions
diff --git a/CHANGELOG-3.7.md b/CHANGELOG-3.7.md
index 7660df9aede..aa7ec430f86 100644
--- a/CHANGELOG-3.7.md
+++ b/CHANGELOG-3.7.md
@@ -45,9 +45,18 @@ These are the changes since Ice 3.7.0 included in this pre-release.
- Slice documentation comments are now preserved in the generated C++
code using Doxygen markup.
-## PHP Changes
+## C# Changes
-- Fixed Ice for PHP build failure when build with PHP5 ZTS
+- Added the ice_initialize partial method to generated structs and classes.
+ This method is called by constructors after initialization of the data
+ members. By implementing this method users can customize struct and
+ class initialization.
+
+## Java Changes
+
+- The java:package metadata can now be applied to modules. It can still
+ be used as global metadata, in which case it serves as the default
+ directive unless overridden by module metadata.
## Objective-C Changes
@@ -55,12 +64,15 @@ These are the changes since Ice 3.7.0 included in this pre-release.
parameters returned by reference. Xcode 9.0 now emits a warning if this
qualifier is omitted.
-## C# Changes
+## PHP Changes
-- Added the ice_initialize partial method to generated structs and classes.
- This method is called by constructors after initialization of the data
- members. By implementing this method users can customize struct and
- class initialization.
+- Fixed Ice for PHP build failure when build with PHP5 ZTS
+
+## Python Changes
+
+- The python:package metadata can now be applied to modules. It can still
+ be used as global metadata, in which case it serves as the default
+ directive unless overridden by module metadata.
## Ruby Changes
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp
index 3cc4a2e3967..0f506c1a391 100644
--- a/cpp/src/Slice/JavaUtil.cpp
+++ b/cpp/src/Slice/JavaUtil.cpp
@@ -431,6 +431,11 @@ private:
result.push_back(s);
continue;
}
+ else if(s.substr(prefix.size(), pos - prefix.size()) == "package")
+ {
+ result.push_back(s);
+ continue;
+ }
dc->warning(InvalidMetaData, cont->file(), cont->line(), "ignoring invalid metadata `" + s + "'");
}
@@ -444,7 +449,8 @@ private:
return result;
}
- StringList validateType(const SyntaxTreeBasePtr& p, const StringList& metaData, const string& file, const string& line)
+ StringList validateType(const SyntaxTreeBasePtr& p, const StringList& metaData, const string& file,
+ const string& line)
{
const UnitPtr unit = p->unit();
const DefinitionContextPtr dc = unit->findDefinitionContext(file);
@@ -520,6 +526,18 @@ private:
dc->warning(InvalidMetaData, file, line, "ignoring invalid metadata `" + *i + "'");
}
}
+ else if(i->find("java:package:") == 0)
+ {
+ ModulePtr m = ModulePtr::dynamicCast(p);
+ if(m && UnitPtr::dynamicCast(m->container()))
+ {
+ newMetaData.push_back(*i);
+ }
+ else
+ {
+ dc->warning(InvalidMetaData, file, line, "ignoring invalid metadata `" + *i + "'");
+ }
+ }
else
{
newMetaData.push_back(*i);
@@ -528,7 +546,8 @@ private:
return newMetaData;
}
- StringList validateGetSet(const SyntaxTreeBasePtr& p, const StringList& metaData, const string& file, const string& line)
+ StringList validateGetSet(const SyntaxTreeBasePtr& p, const StringList& metaData, const string& file,
+ const string& line)
{
const UnitPtr unit = p->unit();
const DefinitionContextPtr dc= unit->findDefinitionContext(file);
@@ -921,25 +940,51 @@ Slice::JavaCompatGenerator::convertScopedName(const string& scoped, const string
string
Slice::JavaCompatGenerator::getPackagePrefix(const ContainedPtr& cont) const
{
- UnitPtr unit = cont->container()->unit();
- string file = cont->file();
- assert(!file.empty());
-
- map<string, string>::const_iterator p = _filePackagePrefix.find(file);
- if(p != _filePackagePrefix.end())
+ //
+ // Traverse to the top-level module.
+ //
+ ModulePtr m;
+ ContainedPtr p = cont;
+ while(true)
{
- return p->second;
+ if(ModulePtr::dynamicCast(p))
+ {
+ m = ModulePtr::dynamicCast(p);
+ }
+
+ ContainerPtr c = p->container();
+ p = ContainedPtr::dynamicCast(c); // This cast fails for Unit.
+ if(!p)
+ {
+ break;
+ }
}
+ assert(m);
+
+ //
+ // The java:package metadata can be defined as global metadata or applied to a top-level module.
+ // We check for the metadata at the top-level module first and then fall back to the global scope.
+ //
static const string prefix = "java:package:";
- DefinitionContextPtr dc = unit->findDefinitionContext(file);
- assert(dc);
- string q = dc->findMetaData(prefix);
+
+ string q;
+ if(!m->findMetaData(prefix, q))
+ {
+ UnitPtr unit = cont->unit();
+ string file = cont->file();
+ assert(!file.empty());
+
+ DefinitionContextPtr dc = unit->findDefinitionContext(file);
+ assert(dc);
+ q = dc->findMetaData(prefix);
+ }
+
if(!q.empty())
{
q = q.substr(prefix.size());
}
- _filePackagePrefix[file] = q;
+
return q;
}
@@ -3375,25 +3420,51 @@ Slice::JavaGenerator::convertScopedName(const string& scoped, const string& pref
string
Slice::JavaGenerator::getPackagePrefix(const ContainedPtr& cont) const
{
- UnitPtr unit = cont->container()->unit();
- string file = cont->file();
- assert(!file.empty());
-
- map<string, string>::const_iterator p = _filePackagePrefix.find(file);
- if(p != _filePackagePrefix.end())
+ //
+ // Traverse to the top-level module.
+ //
+ ModulePtr m;
+ ContainedPtr p = cont;
+ while(true)
{
- return p->second;
+ if(ModulePtr::dynamicCast(p))
+ {
+ m = ModulePtr::dynamicCast(p);
+ }
+
+ ContainerPtr c = p->container();
+ p = ContainedPtr::dynamicCast(c); // This cast fails for Unit.
+ if(!p)
+ {
+ break;
+ }
}
+ assert(m);
+
+ //
+ // The java:package metadata can be defined as global metadata or applied to a top-level module.
+ // We check for the metadata at the top-level module first and then fall back to the global scope.
+ //
static const string prefix = "java:package:";
- DefinitionContextPtr dc = unit->findDefinitionContext(file);
- assert(dc);
- string q = dc->findMetaData(prefix);
+
+ string q;
+ if(!m->findMetaData(prefix, q))
+ {
+ UnitPtr unit = cont->unit();
+ string file = cont->file();
+ assert(!file.empty());
+
+ DefinitionContextPtr dc = unit->findDefinitionContext(file);
+ assert(dc);
+ q = dc->findMetaData(prefix);
+ }
+
if(!q.empty())
{
q = q.substr(prefix.size());
}
- _filePackagePrefix[file] = q;
+
return q;
}
diff --git a/cpp/src/Slice/JavaUtil.h b/cpp/src/Slice/JavaUtil.h
index efb0297ea7d..01ad098c1da 100644
--- a/cpp/src/Slice/JavaUtil.h
+++ b/cpp/src/Slice/JavaUtil.h
@@ -98,7 +98,7 @@ protected:
const std::string& = std::string()) const;
//
- // Returns the package prefix for a give Slice file.
+ // Returns the package prefix of a Contained entity.
//
std::string getPackagePrefix(const ContainedPtr&) const;
@@ -223,7 +223,6 @@ private:
std::string _dir;
::IceUtilInternal::Output* _out;
- mutable std::map<std::string, std::string> _filePackagePrefix;
};
class JavaGenerator : private ::IceUtil::noncopyable
@@ -265,7 +264,7 @@ protected:
const std::string& = std::string()) const;
//
- // Returns the package prefix for a give Slice file.
+ // Returns the package prefix of a Contained entity.
//
std::string getPackagePrefix(const ContainedPtr&) const;
@@ -397,7 +396,6 @@ private:
std::string _dir;
::IceUtilInternal::Output* _out;
- mutable std::map<std::string, std::string> _filePackagePrefix;
};
}
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index 188a5617c0c..8f4b466d6c7 100644
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -3015,18 +3015,51 @@ Slice::Python::fixIdent(const string& ident)
string
Slice::Python::getPackageMetadata(const ContainedPtr& cont)
{
- UnitPtr unit = cont->container()->unit();
- string file = cont->file();
- assert(!file.empty());
+ //
+ // Traverse to the top-level module.
+ //
+ ModulePtr m;
+ ContainedPtr p = cont;
+ while(true)
+ {
+ if(ModulePtr::dynamicCast(p))
+ {
+ m = ModulePtr::dynamicCast(p);
+ }
+
+ ContainerPtr c = p->container();
+ p = ContainedPtr::dynamicCast(c); // This cast fails for Unit.
+ if(!p)
+ {
+ break;
+ }
+ }
+ assert(m);
+
+ //
+ // The python:package metadata can be defined as global metadata or applied to a top-level module.
+ // We check for the metadata at the top-level module first and then fall back to the global scope.
+ //
static const string prefix = "python:package:";
- DefinitionContextPtr dc = unit->findDefinitionContext(file);
- assert(dc);
- string q = dc->findMetaData(prefix);
+
+ string q;
+ if(!m->findMetaData(prefix, q))
+ {
+ UnitPtr unit = cont->unit();
+ string file = cont->file();
+ assert(!file.empty());
+
+ DefinitionContextPtr dc = unit->findDefinitionContext(file);
+ assert(dc);
+ q = dc->findMetaData(prefix);
+ }
+
if(!q.empty())
{
q = q.substr(prefix.size());
}
+
return q;
}
@@ -3114,7 +3147,31 @@ Slice::Python::MetaDataVisitor::visitUnitStart(const UnitPtr& p)
bool
Slice::Python::MetaDataVisitor::visitModuleStart(const ModulePtr& p)
{
- reject(p);
+ static const string prefix = "python:package:";
+
+ StringList metaData = p->getMetaData();
+ for(StringList::const_iterator r = metaData.begin(); r != metaData.end();)
+ {
+ string s = *r++;
+ if(s.find(prefix) == 0)
+ {
+ //
+ // Must be a top-level module.
+ //
+ if(UnitPtr::dynamicCast(p->container()))
+ {
+ continue;
+ }
+ }
+
+ if(s.find("python:") == 0)
+ {
+ p->definitionContext()->warning(InvalidMetaData, p->file(), "", "ignoring invalid metadata `" + s + "'");
+ metaData.remove(s);
+ }
+ }
+
+ p->setMetaData(metaData);
return true;
}
diff --git a/cpp/src/Slice/PythonUtil.h b/cpp/src/Slice/PythonUtil.h
index d0967fce529..6f29643be36 100644
--- a/cpp/src/Slice/PythonUtil.h
+++ b/cpp/src/Slice/PythonUtil.h
@@ -46,7 +46,7 @@ std::string scopedToName(const std::string&);
std::string fixIdent(const std::string&);
//
-// Return the package specified in the global metadata for the given definition,
+// Return the package specified by metadata for the given definition,
// or an empty string if no metadata was found.
//
std::string getPackageMetadata(const Slice::ContainedPtr&);
diff --git a/java-compat/test/src/main/java/test/Ice/packagemd/AllTests.java b/java-compat/test/src/main/java/test/Ice/packagemd/AllTests.java
index d1958f707f8..f43cc0fe70e 100644
--- a/java-compat/test/src/main/java/test/Ice/packagemd/AllTests.java
+++ b/java-compat/test/src/main/java/test/Ice/packagemd/AllTests.java
@@ -164,27 +164,27 @@ public class AllTests
// the Test2.* types again (with this communicator) because factories
// have already been cached for them, so now we use the Test3.* types.
//
- communicator.getProperties().setProperty("Ice.Default.Package", "test.Ice.packagemd.testpkg");
- test.Ice.packagemd.testpkg.Test3.C1 c1 = initial.getTest3C2AsC1();
+ communicator.getProperties().setProperty("Ice.Default.Package", "test.Ice.packagemd.modpkg");
+ test.Ice.packagemd.modpkg.Test3.C1 c1 = initial.getTest3C2AsC1();
test(c1 != null);
- test(c1 instanceof test.Ice.packagemd.testpkg.Test3.C2);
- test.Ice.packagemd.testpkg.Test3.C2 c2 = initial.getTest3C2AsC2();
+ test(c1 instanceof test.Ice.packagemd.modpkg.Test3.C2);
+ test.Ice.packagemd.modpkg.Test3.C2 c2 = initial.getTest3C2AsC2();
test(c2 != null);
try
{
initial.throwTest3E2AsE1();
test(false);
}
- catch(test.Ice.packagemd.testpkg.Test3.E1 ex)
+ catch(test.Ice.packagemd.modpkg.Test3.E1 ex)
{
- test(ex instanceof test.Ice.packagemd.testpkg.Test3.E2);
+ test(ex instanceof test.Ice.packagemd.modpkg.Test3.E2);
}
try
{
initial.throwTest3E2AsE2();
test(false);
}
- catch(test.Ice.packagemd.testpkg.Test3.E2 ex)
+ catch(test.Ice.packagemd.modpkg.Test3.E2 ex)
{
// Expected
}
diff --git a/java-compat/test/src/main/java/test/Ice/packagemd/InitialI.java b/java-compat/test/src/main/java/test/Ice/packagemd/InitialI.java
index b07c49e58dd..b2224033195 100644
--- a/java-compat/test/src/main/java/test/Ice/packagemd/InitialI.java
+++ b/java-compat/test/src/main/java/test/Ice/packagemd/InitialI.java
@@ -101,37 +101,37 @@ public final class InitialI extends _InitialDisp
public Ice.Object
getTest3C2AsObject(Ice.Current current)
{
- return new test.Ice.packagemd.testpkg.Test3.C2();
+ return new test.Ice.packagemd.modpkg.Test3.C2();
}
@Override
- public test.Ice.packagemd.testpkg.Test3.C1
+ public test.Ice.packagemd.modpkg.Test3.C1
getTest3C2AsC1(Ice.Current current)
{
- return new test.Ice.packagemd.testpkg.Test3.C2();
+ return new test.Ice.packagemd.modpkg.Test3.C2();
}
@Override
- public test.Ice.packagemd.testpkg.Test3.C2
+ public test.Ice.packagemd.modpkg.Test3.C2
getTest3C2AsC2(Ice.Current current)
{
- return new test.Ice.packagemd.testpkg.Test3.C2();
+ return new test.Ice.packagemd.modpkg.Test3.C2();
}
@Override
public void
throwTest3E2AsE1(Ice.Current current)
- throws test.Ice.packagemd.testpkg.Test3.E1
+ throws test.Ice.packagemd.modpkg.Test3.E1
{
- throw new test.Ice.packagemd.testpkg.Test3.E2();
+ throw new test.Ice.packagemd.modpkg.Test3.E2();
}
@Override
public void
throwTest3E2AsE2(Ice.Current current)
- throws test.Ice.packagemd.testpkg.Test3.E2
+ throws test.Ice.packagemd.modpkg.Test3.E2
{
- throw new test.Ice.packagemd.testpkg.Test3.E2();
+ throw new test.Ice.packagemd.modpkg.Test3.E2();
}
@Override
diff --git a/java-compat/test/src/main/java/test/Ice/packagemd/Package.ice b/java-compat/test/src/main/java/test/Ice/packagemd/Package.ice
index 610179ecc81..71ab05c480a 100644
--- a/java-compat/test/src/main/java/test/Ice/packagemd/Package.ice
+++ b/java-compat/test/src/main/java/test/Ice/packagemd/Package.ice
@@ -10,6 +10,7 @@
#pragma once
[["java:package:test.Ice.packagemd.testpkg"]]
+
module Test2
{
class C1
@@ -33,6 +34,7 @@ exception E2 extends E1
}
}
+["java:package:test.Ice.packagemd.modpkg"]
module Test3
{
class C1
diff --git a/java-compat/test/src/main/java/test/Slice/generation/File1.ice b/java-compat/test/src/main/java/test/Slice/generation/File1.ice
index 30da534aebe..937a2ebdc59 100644
--- a/java-compat/test/src/main/java/test/Slice/generation/File1.ice
+++ b/java-compat/test/src/main/java/test/Slice/generation/File1.ice
@@ -10,12 +10,21 @@
#pragma once
[["java:package:test.Slice.generation"]]
+
module Test
{
interface Interface1
{
- void method();
+ void method();
+}
+
}
+["java:package:test.Slice.generation.modpkg"]
+module Test2
+{
+
+class Class1 {}
+
}
diff --git a/java-compat/test/src/main/java/test/Slice/generation/list-generated.out b/java-compat/test/src/main/java/test/Slice/generation/list-generated.out
index 4b1526e01f5..263f565ad2c 100644
--- a/java-compat/test/src/main/java/test/Slice/generation/list-generated.out
+++ b/java-compat/test/src/main/java/test/Slice/generation/list-generated.out
@@ -4,11 +4,17 @@
<file name="classes/test/Slice/generation/Test/_Interface1Operations.java"/>
<file name="classes/test/Slice/generation/Test/_Interface1OperationsNC.java"/>
<file name="classes/test/Slice/generation/Test/_Marker.java"/>
+ <file name="classes/test/Slice/generation/modpkg/Test2/_Marker.java"/>
<file name="classes/test/Slice/generation/Test/Interface1.java"/>
+ <file name="classes/test/Slice/generation/modpkg/Test2/Class1.java"/>
<file name="classes/test/Slice/generation/Test/Interface1Holder.java"/>
<file name="classes/test/Slice/generation/Test/Interface1PrxHolder.java"/>
+ <file name="classes/test/Slice/generation/modpkg/Test2/Class1Holder.java"/>
+ <file name="classes/test/Slice/generation/modpkg/Test2/Class1PrxHolder.java"/>
<file name="classes/test/Slice/generation/Test/Interface1PrxHelper.java"/>
+ <file name="classes/test/Slice/generation/modpkg/Test2/Class1PrxHelper.java"/>
<file name="classes/test/Slice/generation/Test/Interface1Prx.java"/>
+ <file name="classes/test/Slice/generation/modpkg/Test2/Class1Prx.java"/>
<file name="classes/test/Slice/generation/Test/_Interface1Disp.java"/>
<file name="classes/test/Slice/generation/Test/Callback_Interface1_method.java"/>
</source>
diff --git a/java/test/src/main/java/test/Ice/packagemd/AllTests.java b/java/test/src/main/java/test/Ice/packagemd/AllTests.java
index a009912eb4a..ff90f15c0f5 100644
--- a/java/test/src/main/java/test/Ice/packagemd/AllTests.java
+++ b/java/test/src/main/java/test/Ice/packagemd/AllTests.java
@@ -161,27 +161,27 @@ public class AllTests
// the Test2.* types again (with this communicator) because factories
// have already been cached for them, so now we use the Test3.* types.
//
- communicator.getProperties().setProperty("Ice.Default.Package", "test.Ice.packagemd.testpkg");
- test.Ice.packagemd.testpkg.Test3.C1 c1 = initial.getTest3C2AsC1();
+ communicator.getProperties().setProperty("Ice.Default.Package", "test.Ice.packagemd.modpkg");
+ test.Ice.packagemd.modpkg.Test3.C1 c1 = initial.getTest3C2AsC1();
test(c1 != null);
- test(c1 instanceof test.Ice.packagemd.testpkg.Test3.C2);
- test.Ice.packagemd.testpkg.Test3.C2 c2 = initial.getTest3C2AsC2();
+ test(c1 instanceof test.Ice.packagemd.modpkg.Test3.C2);
+ test.Ice.packagemd.modpkg.Test3.C2 c2 = initial.getTest3C2AsC2();
test(c2 != null);
try
{
initial.throwTest3E2AsE1();
test(false);
}
- catch(test.Ice.packagemd.testpkg.Test3.E1 ex)
+ catch(test.Ice.packagemd.modpkg.Test3.E1 ex)
{
- test(ex instanceof test.Ice.packagemd.testpkg.Test3.E2);
+ test(ex instanceof test.Ice.packagemd.modpkg.Test3.E2);
}
try
{
initial.throwTest3E2AsE2();
test(false);
}
- catch(test.Ice.packagemd.testpkg.Test3.E2 ex)
+ catch(test.Ice.packagemd.modpkg.Test3.E2 ex)
{
// Expected
}
diff --git a/java/test/src/main/java/test/Ice/packagemd/InitialI.java b/java/test/src/main/java/test/Ice/packagemd/InitialI.java
index df2b45010f5..b118addf596 100644
--- a/java/test/src/main/java/test/Ice/packagemd/InitialI.java
+++ b/java/test/src/main/java/test/Ice/packagemd/InitialI.java
@@ -89,33 +89,33 @@ public final class InitialI implements Initial
public com.zeroc.Ice.Value getTest3C2AsObject(com.zeroc.Ice.Current current)
{
- return new test.Ice.packagemd.testpkg.Test3.C2();
+ return new test.Ice.packagemd.modpkg.Test3.C2();
}
@Override
- public test.Ice.packagemd.testpkg.Test3.C1 getTest3C2AsC1(com.zeroc.Ice.Current current)
+ public test.Ice.packagemd.modpkg.Test3.C1 getTest3C2AsC1(com.zeroc.Ice.Current current)
{
- return new test.Ice.packagemd.testpkg.Test3.C2();
+ return new test.Ice.packagemd.modpkg.Test3.C2();
}
@Override
- public test.Ice.packagemd.testpkg.Test3.C2 getTest3C2AsC2(com.zeroc.Ice.Current current)
+ public test.Ice.packagemd.modpkg.Test3.C2 getTest3C2AsC2(com.zeroc.Ice.Current current)
{
- return new test.Ice.packagemd.testpkg.Test3.C2();
+ return new test.Ice.packagemd.modpkg.Test3.C2();
}
@Override
public void throwTest3E2AsE1(com.zeroc.Ice.Current current)
- throws test.Ice.packagemd.testpkg.Test3.E1
+ throws test.Ice.packagemd.modpkg.Test3.E1
{
- throw new test.Ice.packagemd.testpkg.Test3.E2();
+ throw new test.Ice.packagemd.modpkg.Test3.E2();
}
@Override
public void throwTest3E2AsE2(com.zeroc.Ice.Current current)
- throws test.Ice.packagemd.testpkg.Test3.E2
+ throws test.Ice.packagemd.modpkg.Test3.E2
{
- throw new test.Ice.packagemd.testpkg.Test3.E2();
+ throw new test.Ice.packagemd.modpkg.Test3.E2();
}
@Override
diff --git a/java/test/src/main/java/test/Ice/packagemd/Package.ice b/java/test/src/main/java/test/Ice/packagemd/Package.ice
index 610179ecc81..71ab05c480a 100644
--- a/java/test/src/main/java/test/Ice/packagemd/Package.ice
+++ b/java/test/src/main/java/test/Ice/packagemd/Package.ice
@@ -10,6 +10,7 @@
#pragma once
[["java:package:test.Ice.packagemd.testpkg"]]
+
module Test2
{
class C1
@@ -33,6 +34,7 @@ exception E2 extends E1
}
}
+["java:package:test.Ice.packagemd.modpkg"]
module Test3
{
class C1
diff --git a/java/test/src/main/java/test/Slice/generation/File1.ice b/java/test/src/main/java/test/Slice/generation/File1.ice
index 30da534aebe..937a2ebdc59 100644
--- a/java/test/src/main/java/test/Slice/generation/File1.ice
+++ b/java/test/src/main/java/test/Slice/generation/File1.ice
@@ -10,12 +10,21 @@
#pragma once
[["java:package:test.Slice.generation"]]
+
module Test
{
interface Interface1
{
- void method();
+ void method();
+}
+
}
+["java:package:test.Slice.generation.modpkg"]
+module Test2
+{
+
+class Class1 {}
+
}
diff --git a/java/test/src/main/java/test/Slice/generation/list-generated.out b/java/test/src/main/java/test/Slice/generation/list-generated.out
index 8d60b86fdf5..919d3b6bfd8 100644
--- a/java/test/src/main/java/test/Slice/generation/list-generated.out
+++ b/java/test/src/main/java/test/Slice/generation/list-generated.out
@@ -2,7 +2,9 @@
<generated>
<source name="File1.ice">
<file name="classes/test/Slice/generation/Test/_Marker.java"/>
+ <file name="classes/test/Slice/generation/modpkg/Test2/_Marker.java"/>
<file name="classes/test/Slice/generation/Test/Interface1.java"/>
+ <file name="classes/test/Slice/generation/modpkg/Test2/Class1.java"/>
<file name="classes/test/Slice/generation/Test/Interface1Prx.java"/>
<file name="classes/test/Slice/generation/Test/_Interface1PrxI.java"/>
</source>
diff --git a/python/test/Ice/packagemd/AllTests.py b/python/test/Ice/packagemd/AllTests.py
index cc609a634ad..90e637dcecc 100644
--- a/python/test/Ice/packagemd/AllTests.py
+++ b/python/test/Ice/packagemd/AllTests.py
@@ -7,7 +7,7 @@
#
# **********************************************************************
-import Ice, Test, Test1, testpkg, sys, threading, time, traceback
+import Ice, Test, Test1, testpkg, modpkg, sys, threading, time, traceback
def test(b):
if not b:
@@ -76,18 +76,18 @@ def allTests(communicator):
c1 = initial.getTest3C2AsC1()
test(c1)
- test(isinstance(c1, testpkg.Test3.C2))
+ test(isinstance(c1, modpkg.Test3.C2))
c2 = initial.getTest3C2AsC2()
test(c2)
try:
initial.throwTest3E2AsE1()
test(False)
- except testpkg.Test3.E1 as ex:
- test(isinstance(ex, testpkg.Test3.E2))
+ except modpkg.Test3.E1 as ex:
+ test(isinstance(ex, modpkg.Test3.E2))
try:
initial.throwTest3E2AsE2()
test(False)
- except testpkg.Test3.E2 as ex:
+ except modpkg.Test3.E2 as ex:
# Expected
pass
diff --git a/python/test/Ice/packagemd/Package.ice b/python/test/Ice/packagemd/Package.ice
index 0ea301fcfc9..fdcd4437b33 100644
--- a/python/test/Ice/packagemd/Package.ice
+++ b/python/test/Ice/packagemd/Package.ice
@@ -33,6 +33,7 @@ exception E2 extends E1
}
}
+["python:package:modpkg"]
module Test3
{
class C1
diff --git a/python/test/Ice/packagemd/Server.py b/python/test/Ice/packagemd/Server.py
index a71ef1bfb8f..56c40959686 100755
--- a/python/test/Ice/packagemd/Server.py
+++ b/python/test/Ice/packagemd/Server.py
@@ -12,7 +12,7 @@ import os, sys, traceback
import Ice
Ice.loadSlice('--all -I. Test.ice')
-import Test, Test1, testpkg
+import Test, Test1, testpkg, modpkg
class InitialI(Test.Initial):
@@ -50,19 +50,19 @@ class InitialI(Test.Initial):
raise testpkg.Test2.E2()
def getTest3C2AsObject(self, current):
- return testpkg.Test3.C2()
+ return modpkg.Test3.C2()
def getTest3C2AsC1(self, current):
- return testpkg.Test3.C2()
+ return modpkg.Test3.C2()
def getTest3C2AsC2(self, current):
- return testpkg.Test3.C2()
+ return modpkg.Test3.C2()
def throwTest3E2AsE1(self, current):
- raise testpkg.Test3.E2()
+ raise modpkg.Test3.E2()
def throwTest3E2AsE2(self, current):
- raise testpkg.Test3.E2()
+ raise modpkg.Test3.E2()
def shutdown(self, current):
current.adapter.getCommunicator().shutdown()