summaryrefslogtreecommitdiff
path: root/java/demo
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-07-25 07:04:46 +0000
committerMichi Henning <michi@zeroc.com>2002-07-25 07:04:46 +0000
commit9e9f73e98a399180afc1a618bd4cba534fa5ed7b (patch)
tree87ab44e1284c95a9f129a7536225c6b4df79de65 /java/demo
parentFixes (diff)
downloadice-9e9f73e98a399180afc1a618bd4cba534fa5ed7b.tar.bz2
ice-9e9f73e98a399180afc1a618bd4cba534fa5ed7b.tar.xz
ice-9e9f73e98a399180afc1a618bd4cba534fa5ed7b.zip
Changed Slice parser to disallow leading underscore for identifiers.
Changed Slice parser to reject identifiers beginning with "Ice", unless the --ice option is used. Changed Slice parser to disallow identifiers that have a trailing "Operations", "Holder", "Helper", "Prx", or "Ptr", to avoid clashes with language mappings. Fixed tests and remaining code base to work correctly with the changed rules.
Diffstat (limited to 'java/demo')
-rw-r--r--java/demo/Freeze/library/BookI.java18
-rw-r--r--java/demo/Freeze/library/Library.ice4
-rw-r--r--java/demo/Freeze/library/LibraryI.java2
-rw-r--r--java/demo/Freeze/phonebook/ContactI.java22
-rw-r--r--java/demo/Freeze/phonebook/PhoneBook.ice6
-rw-r--r--java/demo/Ice/value/Client.java8
-rw-r--r--java/demo/Ice/value/DerivedPrinterI.java4
-rw-r--r--java/demo/Ice/value/InitialI.java8
-rw-r--r--java/demo/Ice/value/PrinterI.java2
-rw-r--r--java/demo/Ice/value/Value.ice6
10 files changed, 40 insertions, 40 deletions
diff --git a/java/demo/Freeze/library/BookI.java b/java/demo/Freeze/library/BookI.java
index aa1c56994c6..8cc4622c9a7 100644
--- a/java/demo/Freeze/library/BookI.java
+++ b/java/demo/Freeze/library/BookI.java
@@ -21,40 +21,40 @@ class BookI extends Book
//
// Immutable.
//
- return _description;
+ return description;
}
synchronized public String
getRenterName(Ice.Current current)
throws BookNotRentedException
{
- if(_rentalCustomerName.length() == 0)
+ if(rentalCustomerName.length() == 0)
{
throw new BookNotRentedException();
}
- return _rentalCustomerName;
+ return rentalCustomerName;
}
synchronized public void
rentBook(String name, Ice.Current current)
throws BookRentedException
{
- if(_rentalCustomerName.length() != 0)
+ if(rentalCustomerName.length() != 0)
{
throw new BookRentedException();
}
- _rentalCustomerName = name;
+ rentalCustomerName = name;
}
synchronized public void
returnBook(Ice.Current current)
throws BookNotRentedException
{
- if(_rentalCustomerName.length() == 0)
+ if(rentalCustomerName.length() == 0)
{
throw new BookNotRentedException();
}
- _rentalCustomerName = new String();;
+ rentalCustomerName = new String();;
}
synchronized public void
@@ -63,7 +63,7 @@ class BookI extends Book
{
try
{
- _library.remove(_description);
+ _library.remove(description);
}
catch(Freeze.DBNotFoundException ex)
{
@@ -88,7 +88,7 @@ class BookI extends Book
// new creation of a book, and the other for restoring a
// previously saved book).
//
- _rentalCustomerName = new String();
+ rentalCustomerName = new String();
}
private LibraryI _library;
diff --git a/java/demo/Freeze/library/Library.ice b/java/demo/Freeze/library/Library.ice
index 93f1e980048..7c4440200b1 100644
--- a/java/demo/Freeze/library/Library.ice
+++ b/java/demo/Freeze/library/Library.ice
@@ -137,7 +137,7 @@ class Book
* this information is immutable.
*
**/
- BookDescription _description;
+ BookDescription description;
/**
*
@@ -145,7 +145,7 @@ class Book
* the book is not currently rented.
*
**/
- string _rentalCustomerName;
+ string rentalCustomerName;
};
/**
diff --git a/java/demo/Freeze/library/LibraryI.java b/java/demo/Freeze/library/LibraryI.java
index c2bdf53691b..2cafbde3bd3 100644
--- a/java/demo/Freeze/library/LibraryI.java
+++ b/java/demo/Freeze/library/LibraryI.java
@@ -36,7 +36,7 @@ class LibraryI extends _LibraryDisp
// Create a new book Servant.
//
BookI bookI = new BookI(this);
- bookI._description = description;
+ bookI.description = description;
Ice.Identity ident = createBookIdentity(description.isbn);
diff --git a/java/demo/Freeze/phonebook/ContactI.java b/java/demo/Freeze/phonebook/ContactI.java
index 27249e7a648..fc975326c56 100644
--- a/java/demo/Freeze/phonebook/ContactI.java
+++ b/java/demo/Freeze/phonebook/ContactI.java
@@ -18,7 +18,7 @@ class ContactI extends Contact
synchronized public String
getName(Ice.Current current)
{
- return _name;
+ return name;
}
synchronized public void
@@ -26,32 +26,32 @@ class ContactI extends Contact
throws DatabaseException
{
assert(_identity.name.length() != 0);
- _phonebook.move(_identity, _name, name);
- _name = name;
+ _phonebook.move(_identity, this.name, name);
+ this.name = name;
}
synchronized public String
getAddress(Ice.Current current)
{
- return _address;
+ return address;
}
synchronized public void
setAddress(String address, Ice.Current current)
{
- _address = address;
+ this.address = address;
}
synchronized public String
getPhone(Ice.Current current)
{
- return _phone;
+ return phone;
}
synchronized public void
setPhone(String phone, Ice.Current current)
{
- _phone = phone;
+ this.phone = phone;
}
synchronized public void
@@ -61,7 +61,7 @@ class ContactI extends Contact
try
{
assert(_identity.name.length() != 0);
- _phonebook.remove(_identity, _name);
+ _phonebook.remove(_identity, name);
//
// This can throw EvictorDeactivatedException (which
@@ -94,9 +94,9 @@ class ContactI extends Contact
// - one for original creation of the Contact and one for
// loading of an existing Contact.
//
- _name = new String();
- _address = new String();
- _phone = new String();
+ name = new String();
+ address = new String();
+ phone = new String();
}
protected void
diff --git a/java/demo/Freeze/phonebook/PhoneBook.ice b/java/demo/Freeze/phonebook/PhoneBook.ice
index a60fe32da49..2cb2179e424 100644
--- a/java/demo/Freeze/phonebook/PhoneBook.ice
+++ b/java/demo/Freeze/phonebook/PhoneBook.ice
@@ -36,9 +36,9 @@ class Contact
//
["nonmutating"] void destroy() throws DatabaseException;
- string _name;
- string _address;
- string _phone;
+ string name;
+ string address;
+ string phone;
};
sequence<Contact*> Contacts;
diff --git a/java/demo/Ice/value/Client.java b/java/demo/Ice/value/Client.java
index f522f246d65..c5400db0aae 100644
--- a/java/demo/Ice/value/Client.java
+++ b/java/demo/Ice/value/Client.java
@@ -53,7 +53,7 @@ public class Client
readline(in);
Simple simple = initial.getSimple();
- System.out.println("==> " + simple._message);
+ System.out.println("==> " + simple.message);
System.out.println();
System.out.println("Ok, this worked. Now let's try to transfer an object for a class");
@@ -84,7 +84,7 @@ public class Client
communicator.addObjectFactory(factory, "::Printer");
initial.getPrinter(printer, printerProxy);
- System.out.println("==> " + printer.value._message);
+ System.out.println("==> " + printer.value.message);
System.out.println();
System.out.println("Cool, it worked! Let's try calling the printBackwards() method");
@@ -143,7 +143,7 @@ public class Client
System.out.println("[press enter]");
readline(in);
- System.out.println("==> " + derived._derivedMessage);
+ System.out.println("==> " + derived.derivedMessage);
System.out.print("==> ");
derived.printUppercase(null);
@@ -164,7 +164,7 @@ public class Client
assert(derived != null);
}
- System.out.println("==> " + derived._derivedMessage);
+ System.out.println("==> " + derived.derivedMessage);
System.out.print("==> ");
derived.printUppercase(null);
diff --git a/java/demo/Ice/value/DerivedPrinterI.java b/java/demo/Ice/value/DerivedPrinterI.java
index 26f1ffdf53d..8504f0d9d57 100644
--- a/java/demo/Ice/value/DerivedPrinterI.java
+++ b/java/demo/Ice/value/DerivedPrinterI.java
@@ -13,7 +13,7 @@ class DerivedPrinterI extends DerivedPrinter
public void
printBackwards(Ice.Current current)
{
- char[] arr = _message.toCharArray();
+ char[] arr = message.toCharArray();
for(int i = 0; i < arr.length / 2; i++)
{
char tmp = arr[arr.length - i - 1];
@@ -26,6 +26,6 @@ class DerivedPrinterI extends DerivedPrinter
public void
printUppercase(Ice.Current current)
{
- System.out.println(_derivedMessage.toUpperCase());
+ System.out.println(derivedMessage.toUpperCase());
}
}
diff --git a/java/demo/Ice/value/InitialI.java b/java/demo/Ice/value/InitialI.java
index e4c9940e4e5..53137458fa5 100644
--- a/java/demo/Ice/value/InitialI.java
+++ b/java/demo/Ice/value/InitialI.java
@@ -15,16 +15,16 @@ class InitialI extends Initial
_adapter = adapter;
_simple = new Simple();
- _simple._message = "a message 4 u";
+ _simple.message = "a message 4 u";
_printer = new PrinterI();
- _printer._message = "Ice rulez!";
+ _printer.message = "Ice rulez!";
_printerProxy =
PrinterPrxHelper.uncheckedCast(adapter.addWithUUID(_printer));
_derivedPrinter = new DerivedPrinterI();
- _derivedPrinter._message = _printer._message;
- _derivedPrinter._derivedMessage = "Coming soon: the ultimate online " +
+ _derivedPrinter.message = _printer.message;
+ _derivedPrinter.derivedMessage = "Coming soon: the ultimate online " +
"game from MutableRealms!";
adapter.addWithUUID(_derivedPrinter);
}
diff --git a/java/demo/Ice/value/PrinterI.java b/java/demo/Ice/value/PrinterI.java
index cb50b62fbec..deec1858606 100644
--- a/java/demo/Ice/value/PrinterI.java
+++ b/java/demo/Ice/value/PrinterI.java
@@ -13,7 +13,7 @@ class PrinterI extends Printer
public void
printBackwards(Ice.Current current)
{
- char[] arr = _message.toCharArray();
+ char[] arr = message.toCharArray();
for(int i = 0; i < arr.length / 2; i++)
{
char tmp = arr[arr.length - i - 1];
diff --git a/java/demo/Ice/value/Value.ice b/java/demo/Ice/value/Value.ice
index 8dbe0e42b88..4c5c860ecf7 100644
--- a/java/demo/Ice/value/Value.ice
+++ b/java/demo/Ice/value/Value.ice
@@ -13,18 +13,18 @@
class Simple
{
- string _message;
+ string message;
};
class Printer
{
- string _message;
+ string message;
void printBackwards();
};
class DerivedPrinter extends Printer
{
- string _derivedMessage;
+ string derivedMessage;
void printUppercase();
};