Design flaw in overloading? Problem with visitor pattern

I have been trying some implementations of the Visitor pattern in Java and have encountered a problem with overloaded methods in Java. It seems that the caller (client) of a overloaded method decides what implementation of that method is chosen. I find that strange from an OO / encapsulation point of view and it gets me into problems when using Visitor. This code shows my problem:
// a class with overloaded methods
public class OverLoadingTest {
     public void print(String s) {
          System.out.println("This looks like a String to me:");
          System.out.println("\"" + s + "\"");
     public void print(Object o) {
          System.out.println("This looks like an Object to me:");
          System.out.println("\"" + o + "\"");
//a client for that class
public class OverLoadingTestClient {
     public void test() {
          OverLoadingTest test = new OverLoadingTest();
          Object o1 = "String in an Object reference";
          String s1 = "String in a String reference";
          test.print(o1);
          test.print(s1);
     public static void main(String[] args) {
          new OverLoadingTestClient().test();
//And the output is:
This looks like an Object to me:
"String in an Object reference"
This looks like a String to me:
"String in a String reference"
//The output I would have expeced (wanted):
This looks like a String to me: //it is a String!
"String in an Object reference"
This looks like a String to me:
"String in a String reference"
Why is this? Is there a work around?

The specific method is decided on in compile time and by the client of that method, not the provider. I'd expect the client to just invoke the method and let the privider figure out what implementation to choose. Whatever the client thinks that he is providing as argument types.
I am implementing a slightly different version compared to http://ootips.org/visitor-pattern.html. I find implementing "v.visit(this);" for every subclass of the Visisted superclass strange. Why an abstract method "accept(Visitor v);" when all subclasses will iplement it in the same way ("v.visit(this);")?
Daan

Similar Messages

  • Problem with a pattern

    I have a problem with a pattern.
    I want to put a patter to validate an e-mail but i don´t find the way to do it

    Hi Veloki,
    You can drag and drop custom "email Adress" object from Custom Object Library. It includes the script for email validation in the validate event of email area.
    // Validate the email address.
    var r = new RegExp("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,3}$"); // Create a new Regular Expression Object.
    // Set the regular expression to look for an email address in general form.
    var result = r.test(this.rawValue); // Test the rawValue of the current object to see
    // if it fits the general form of an email address.
    if (result == true) // If it fits the general form,
    true; // all is well.
    else // Otherwise,
    false; // fail the validation.
    Asiye

  • Problems with Factory pattern

    Sorry... I know this topic has been done to death but I still have some questions.
    In my development, I keep encountering a recurring problem that I believe should be solved by the 'factory pattern'. (Note: I'm not a patterns nut so I am only guessing about the correct pattern).
    Here is the problem:
    I develop an abstract base class. I extend the base class with several subclasses. Exterior objects use the instances via a base class reference and I don't want to them to have to know which is the correct subclass or how to create the instance.
    My solution is to make a create(param, param,...) method in the base class and using the param(s) construct the instance something like:static Foo create(int type)
    Foo instance = null;
    String className = "com.myco.foos.DefaultFoo";
    if(CONST_A == type)
      className = "com.myco.foos.FooA";
    else if(CONST_B == type)
      className = "com.myco.foos.FooB";
    {on and on...}
    {using reflection create a new instance from the className String}
    return instance;
    }The obvious problem with the create() method is that it becomes a maintenence point and I don't like the idea of a base class knowing about subclasses.
    Anyone know better a solution? Comments?
    Thanks in advance.

    Yes, that is the Factory pattern you describe. The client programs are going to call your createFoo() method and get back an instance of a subclass of Foo. Typically this pattern is used where there is some external entity that determines what subclass will be returned -- for example a system property -- and the client programs call createFoo() with no arguments. In this case reflection is used to create the instance, and your base class does not need to know anything about any subclasses.
    However, if your client programs can influence the choice of subclass, then they will have to pass some kind of parameter into createFoo(). At this point, createFoo() requires some decision logic that says "create this, or that, depending on the input parameter". And if that parameter is simply a code that enables the client programs to say "Give me a ChocolateFoo instance", then returning "new ChocolateFoo()" is the most straightforward design. But in this case, why can't the client program do that?
    If you don't like the base class having to know about subclasses (and you shouldn't be happy if it does), then you could have a helper class -- FooFactory -- that contains only the static method createFoo(). This class would know about Foo, and about any of its subclasses that it can produce instances of. It's still a maintenance point, no avoiding that, but at least it is off by itself somewhere.

  • Problem with date pattern

    Hi all,
    I have a little maddening problem with oracle.jbo.domain.Date.
    I have a viewObject with an attribute (fechaCompra) type Date and I need the time too so in controlHints I have defined:
    format type: Simple Date
    Format: yyyy-MM-dd 'at' hh:mm:ss
    Right, on runTime now i see ok the data and in the inputDate appears the calendar and the hour .
    But when I take the value of this attribute, to call a void that takes a oracle.jbo.domain.Date type, raises an error when parses the value of the atribute.
    All this doesn't happen when in the view object the controlHints are defined like this:
    format type: Simple Date
    Format: yyyy-MM-dd
    Any idea?
    Thanks in advance,
    Rowan

    hello,
    My guess would be that when you drop your formatted date into the methode the parse function is called from String to date, this work with no time attached.
    But fails with the time attached. I would double check the specific class you pass to each method to be sure they are correct.
    hat you mention parse gives an even bigger hint that you are using the parse function from oracle.jbo.domain.Date, which takes a string.
    This function will fail with your custom patterns.
    //get the value
    String value = .....
    //Not 100% sure if the at needs to be escaped or not
    DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd at hh:mm:ss");
    //Prolly needs a try catch, writing this by hand
    java.util.Date utilDate = sdf.parse(value);
    java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
    oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date(sqlDate);
    //pass to your method-Anton

  • Problem with phonenumber pattern

    Hello,
    I've got a problem with my display and validation pattern for my phone numbers.
    In Holland we have two sorts of phone numbers:
    Always 10 numbers, but some regions have a 3 digit area code,
    other regions a 4 digit area code.
    Example:
    012-3456789
    0123-456789
    This is also the way I want my users to enter the data.
    I want to display them as followed:
    012-3456789 --> 012 - 345 67 89
    0123-456789 --> 0123 - 456 789
    My display pattern right now is: text{999 - 999 99 99}|text{9999 - 999 999}
    My edit pattern is: text{999-9999999}|text{9999-999999}
    My validation pattern is: text{999-9999999}|text{9999-999999}
    (With a pop-up message to fill in 10 numbers, area code seperated from the rest by a dash, as in the example)
    The problem is that the validation works fine, but it always transforms the phonenumber to the first option (999 - 999 99 99).
    How can I fix this?
    Greetings and thanks in advance,
    Sterre

    Hi Veloki,
    You can drag and drop custom "email Adress" object from Custom Object Library. It includes the script for email validation in the validate event of email area.
    // Validate the email address.
    var r = new RegExp("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,3}$"); // Create a new Regular Expression Object.
    // Set the regular expression to look for an email address in general form.
    var result = r.test(this.rawValue); // Test the rawValue of the current object to see
    // if it fits the general form of an email address.
    if (result == true) // If it fits the general form,
    true; // all is well.
    else // Otherwise,
    false; // fail the validation.
    Asiye

  • Intermittent problems with strange patterns on screen

    My new (refurbed) 17in Intel Imac starts up periodically with a strange pattern running at 45 degrees across the entire screen (little multicolor boxes or rectangles) then the screen goes to all blue and freezes with no further activity. I have run the hardware test, reset pram and disk utility with no solutions. It will still boot up perfectly about every 3rd attempt. I'm running 10.4.10. Any help would be greatly appreciated.

    To make sure that this is not software related, set it back to factory settings, without using a backup afterwards, described in this article:
    Use iTunes to restore your iOS device to factory settings - Apple Support
    If the screen has still this pattern, the issue is hardware related and the phone needs to be serviced. In that case it might be enough to let Apple replace the screen.
    Screen repair service pricing
    Repair and replacement costs depend on your iPhone model and your AppleCare product coverage. Apple will run a diagnostic test to determine whether your iPhone has experienced additional damage. If it has, or if it needs other repairs, you may need to pay an out-of-warranty service fee. Accidental damage isn't covered under the Apple One Year Limited Warranty.
    Model
    Screen repair cost
    iPhone 6
    $109
    iPhone 6 Plus, iPhone 5s, iPhone 5c, iPhone 5
    $129
    Plus a $6.95 shipping fee, if required. Fees are in USD and exclude local tax. Pricing is for service through Apple. The final service fee we charge will be determined during testing. Pricing and terms vary for service through an Apple Authorized Service Provider.
    copied from Service Answer Center - iPhone

  • Problem with fill pattern in oracle reports 11g

    Hi all,
    regardless of the fill pattern we use, on paper lines with a fill pattern appear completely black
    no longer using a fill pattern is not an option as we have > 200 reports (migrated from 6i) that use them
    running such a report from the builder choosing paper layout does show the report output correctly on our development PCs
    development PC OS : XP
    WLS 10.3.3 (32 bit)
    Reports builder 11.1.1.3.0
    server : Win 2008 64 bit
    WLS 10.3.3 (64 bit)
    report output is PDF
    the way we work when a user prints a report, the pdf is created on the reports server and then send to the client using webutil and then the report is printed using Adobe Reader 9.3.2
    any ideas ?
    thx in advance
    Kr
    Martin

    anyone ?

  • ASAP PLZ- Having problems with basic pattern input/output

    Hey! I am new to this forum, and I am also new to java =).
    I am writing a program that prompts a user to select 1 pattern out of 5. then the user needs to choose the number of lines he/she wants to display for instace:
    (MENU)
    PATTERN 5
    1
    12
    123
    1234
    USER Selection : Pattern 5
    Choose Number of Lines: 3
    OUTPUT
    Pattern 5
    1
    12
    123
    I have a basic code for a pyramid that deals with leading spaces etc.. but I don't have a clue how to use that method with my program
    MY PROGRAM:
    //Purpose:     Displaying Patterns
    //Input:          User's selection
    //Output:     Messages
    //Author;     Fares
    //Program:     4
    //Date:          9/15/2009
    import java.util.Scanner;
    public class MyPatterns4{
    public static void main(String[] args) {
    // Declarations
    Scanner scan = new Scanner(System.in);
         String outputString;
         int option = 1;
         int lines;
         // Paterns
         String patternOne;
         patternOne = "\n\t Pattern I \n\t 1 \n\t 12 \n\t 123 \n\t 1234 \n\t 12345 \n\t 123456";
         String patternTwo;
         patternTwo= "\n\t Pattern II \n\t 123456 \n\t 12345 \n\t 1234 \n\t 123 \n\t 12 \n\t 1";
         String patternThree;
         patternThree = "\n\t Pattern III \n\t 1 \n\t 21 \n\t 321 \n\t 4321 \n\t 54321 \n\t 654321";
         String patternFour;
         patternFour = "\n\t Pattern IV \n\t 123456 \n\t 12345 \n\t 1234 \n\t 123 \n\t 12 \n\t 1";
         String patternFive;
         patternFive = "\n\t Pattern V \n\t 1 \n\t 12 \n\t 123 \n\t 123456 \n\t 123 \n\t 12";
         // Prompt the user to select a pattern
         outputString = "------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t" +
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t" +
              "5 Display Pattern V\n\t" + "6 Display All Patterns\n\n\n\t" + "0 Quit\n\n\n";
         System.out.println(outputString);
         System.out.print("\tEnter your selection: ");
         option = scan.nextInt();     
         // Keep reading data until the user enters 0
         while (option !=0){     
                   while (option == 6) {
                   outputString = "\nChoose another selections!\n";
                                       System.out.println(patternOne);
                                       System.out.println(patternTwo);
                                       System.out.println(patternThree);
                                       System.out.println(patternFour);
                                       System.out.println(patternFive);
                                       System.out.println(outputString);
              outputString = "--------------------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t" +
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t" +
              "5 Display Pattern V\n\t" + "6 Display All Patterns\n\n\n\t" + "0 Quit\n\n\n";
              System.out.println(outputString);
              System.out.print("\tEnter your selection: ");
              option = scan.nextInt();     
    while (option != 0 && option !=6) {
                   System.out.print("\tEnter number of lines: ");
                   lines = scan.nextInt();     
                   if (lines < 1 || lines > 6) {
    System.out.println("\tYou must enter a number from 1 to 6");
              System.out.print("\tEnter number of lines: ");
                   lines = scan.nextInt();          
              while (lines < 1 || lines > 6) {
    System.out.println("\tYou must enter a number from 1 to 6. The program will now end.");
    System.exit(0);}
                   switch (option) {
                        case 1: // write the code to display Pattern I here
                                       outputString = "\n Choose another selection! \n";
                                       System.out.println(patternOne);
                                       System.out.println(outputString);
                                       break;
                        case 2:      // write the code to display Pattern II here
                                       outputString = "\nChoose another selection!\n";
                                       System.out.println(patternTwo);
                                       System.out.println(outputString);
                                       break;
                        case 3:     // write the code to display Pattern III here
                                       outputString = "\nChoose another selection!\n";
                                       System.out.println(patternThree);          
                                       System.out.println(outputString);
                                       break;
                        case 4:      // write the code to display Pattern IV here
                                       outputString = "\nChoose another selection!\n";
                                       System.out.println(patternFour);
                                       System.out.println(outputString);
                                       break;
                        case 5:      // write the code to display Pattern V here
                                       outputString = "\nChoose another selection!\n";
                                       System.out.println(patternFive);
                                       System.out.println(outputString);
                                       break;
                        case 6: // the code to display all paterns
                                       outputString = "\nChoose another selections!\n";
                                       System.out.println(patternOne);
                                       System.out.println(patternTwo);
                                       System.out.println(patternThree);
                                       System.out.println(patternFour);
                                       System.out.println(patternFive);
                                       System.out.println(outputString);
                                       break;
                        default: outputString = "\nInvalid Selection\n";
                                       System.out.println(outputString);
                                       break;
                   }// end of switch
              outputString = "------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t" +
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t" +
              "5 Display Pattern V\n\t" + "6 Display All Patterns\n\n\n\t" + "0 Quit\n\n\n";
              System.out.println(outputString);
              System.out.print("\tEnter your selection: ");
              option = scan.nextInt();     
    } }// end of while loop
    }// end of main method
    }// end of class

    //Purpose: Displaying Patterns
    //Input: User's selection
    //Output: Messages
    //Author; Fares
    //Program: 4
    //Date: 9/15/2009
    import java.util.Scanner;
    public class MyPatterns4{
    public static void main(String[] args) {
    // Declarations
    Scanner scan = new Scanner(System.in);
    String outputString;
    int option = 1;
    int lines;
    // Paterns
    String patternOne;
    patternOne = "\n\t Pattern I \n\t 1 \n\t 12 \n\t 123 \n\t 1234 \n\t 12345 \n\t 123456";
    String patternTwo;
    patternTwo= "\n\t Pattern II \n\t 123456 \n\t 12345 \n\t 1234 \n\t 123 \n\t 12 \n\t 1";
    String patternThree;
    patternThree = "\n\t Pattern III \n\t 1 \n\t 21 \n\t 321 \n\t 4321 \n\t 54321 \n\t 654321";
    String patternFour;
    patternFour = "\n\t Pattern IV \n\t 123456 \n\t 12345 \n\t 1234 \n\t 123 \n\t 12 \n\t 1";
    String patternFive;
    patternFive = "\n\t Pattern V \n\t 1 \n\t 12 \n\t 123 \n\t 123456 \n\t 123 \n\t 12";
    // Prompt the user to select a pattern
    outputString = "------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t"
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t"
    "5 Display Pattern V\n\t" "6 Display All Patterns\n\n\n\t" "0 Quit\n\n\n";
    System.out.println(outputString);
    System.out.print("\tEnter your selection: ");
    option = scan.nextInt();
    // Keep reading data until the user enters 0
    while (option !=0){
    while (option == 6) {
    outputString = "\nChoose another selections!\n";
    System.out.println(patternOne);
    System.out.println(patternTwo);
    System.out.println(patternThree);
    System.out.println(patternFour);
    System.out.println(patternFive);
    System.out.println(outputString);
    outputString = "--------------------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t"
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t"
    "5 Display Pattern V\n\t" "6 Display All Patterns\n\n\n\t" "0 Quit\n\n\n";
    System.out.println(outputString);
    System.out.print("\tEnter your selection: ");
    option = scan.nextInt();
    while (option != 0 && option !=6) {
    System.out.print("\tEnter number of lines: ");
    lines = scan.nextInt();
    if (lines < 1 || lines > 6) {
    System.out.println("\tYou must enter a number from 1 to 6");
    System.out.print("\tEnter number of lines: ");
    lines = scan.nextInt();
    while (lines < 1 || lines > 6) {
    System.out.println("\tYou must enter a number from 1 to 6. The program will now end.");
    System.exit(0);}
    switch (option) {
    case 1: // write the code to display Pattern I here
    outputString = "\n Choose another selection! \n";
    System.out.println(patternOne);
    System.out.println(outputString);
    break;
    case 2: // write the code to display Pattern II here
    outputString = "\nChoose another selection!\n";
    System.out.println(patternTwo);
    System.out.println(outputString);
    break;
    case 3: // write the code to display Pattern III here
    outputString = "\nChoose another selection!\n";
    System.out.println(patternThree);
    System.out.println(outputString);
    break;
    case 4: // write the code to display Pattern IV here
    outputString = "\nChoose another selection!\n";
    System.out.println(patternFour);
    System.out.println(outputString);
    break;
    case 5: // write the code to display Pattern V here
    outputString = "\nChoose another selection!\n";
    System.out.println(patternFive);
    System.out.println(outputString);
    break;
    case 6: // the code to display all paterns
    outputString = "\nChoose another selections!\n";
    System.out.println(patternOne);
    System.out.println(patternTwo);
    System.out.println(patternThree);
    System.out.println(patternFour);
    System.out.println(patternFive);
    System.out.println(outputString);
    break;
    default: outputString = "\nInvalid Selection\n";
    System.out.println(outputString);
    break;
    }// end of switch
    outputString = "------------------------------------\n\t1 Display Pattern I\n\t2 Display Pattern II\n\t"
    "3 Display Pattern III\n\t4 Display Pattern IV\n\t"
    "5 Display Pattern V\n\t" "6 Display All Patterns\n\n\n\t" "0 Quit\n\n\n";
    System.out.println(outputString);
    System.out.print("\tEnter your selection: ");
    option = scan.nextInt();
    } }// end of while loop
    }// end of main method
    }// end of class

  • Funny problem with schema pattern regular expression

    I have following element in my schema:
    <xsd:element name="lD">
         <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                   <xsd:pattern value="\d{5,8}" />
              </xsd:restriction>
         </xsd:simpleType>
    </xsd:element>then in the XML, I have:
    <ID>
    123456789
    </ID>funny thing is the schema validates the value successfully. seems the upper bound of 8 the in the regular expression does not have any effect. however, 1234 would fail.
    i looked up the schema prime on W3C, it specifies that {n,m} means at least n and at most m.
    any idea anyone?
    I have using Xerces 1.4.4.
    Thanks

    I tried the example you mentioned and it seemed to
    work for me. It validated both the upper bound and
    the lower bound. Looking at the Manifest file in
    xerces jar, it looks like I have version 2.5.0yes, I know. Xerces 2 works, but Xerces 1 has the above problem. If you get Xerces 1.4.4 from xml.apache.org, you will see the problem.
    I can not use Xerces 2 in our production environment yet.

  • Problems With url-pattern in a filter-mapping

    Hi!
    I need to make a filter when the clients call a jsf pages in /pages in my web application, but when i make the filter-mapping like this:
         <filter-mapping>
              <filter-name>sessionFilter</filter-name>
              <url-pattern>/pages/*.jsf</url-pattern>
         </filter-mapping>An exception appears:
    SEVERE: Parse error in application web.xml
    java.lang.IllegalArgumentException: Invalid <url-pattern> /pages/*.jsf in filter mapping
         at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
         at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
         at org.apache.commons.digester.Digester.endElement(Digester.java:1061)
         at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         at org.apache.commons.digester.Digester.parse(Digester.java:1548)
         at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:263)
         at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:624)
         at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
         at org.apache.catalina.core.StandardService.start(StandardService.java:480)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)the <url-pattern>/pages/*</url-pattern> not work to me because process all pages, I nedd only *.jsf
    Please Help me whit this.

    "the <url-pattern>/pages/*</url-pattern> not work to me because process all pages, I nedd only *.jsf"
    Yes but in the filter you can get the url from the request.getUrl() and then only process requests that contain .jsf. Simply just pass all other requests along.
    Some information on url pattern matching:
    http://edocs.bea.com/wls/docs61/webapp/components.html#113049

  • Problems with cron pattern in schedule editor

    hi
    I have a transaction that should be executed every 7 seconds. To do this I created a new entry in the schedule editor. Because of the tool to build the cron pattern showed every minute as the most often possible, I looked at the help of xMII.
    There is said, that a pattern of */5 * * * * * would execute every 5 seconds. I changed to */7 * * * * * and saved. The result is, that it is executed every 7 minutes. That is also what I see in the scheduler. Even the pattern * * * * * * that should execute every second according to the help does not what is documented. It executes every minute.
    So the question is, is it possible to execute a transaction every X seconds?
    And the second question, is this a bug in the scheduler or ist the information provided in help wrong?
    Thank you for help.
    Kind regards,
    Timo Bachert

    OK, thank you. Then the help of xMII 12 says wrong (either in german as in english)
    Timo

  • Problem with stretching pattern on footer

    On the master page i have put a triangle on the bottom as my footer and placed on top a pattern. When I look in master page I see that the pattern stretches across the entire page as I require however when I upload the page it appears only partially.  Take a look at my site to see what I mean - www.ozzywizzpop.com
    How can I rectify this?
    Thanks,
    Chris Kimber

    Thanks for the response. I changed the name of the file and it is working properly.
    Just curious to know which component of the server does this work of looking for URL pattern and forwarding the request to the appropriate Servlet. If you can explain i will be really elightened

  • Problem with SimepleDateFormat for the military pattern....

    i have the code, which has to display date in the military format i.e., "yyyyMMddhhmm".
    java.util.Date date = new SimpleDateFormat("yyyyMMddhhmm").parse("200709201700");
    System.out.println("Expected Date : " + date);
    but output displays everytime i.e., Thu Sep 20 17:00:00 IST 2007
    is there any problem with the pattern???

    By military format you mean 24 hour clock time, right? I believe "hh" in SimpleDateFormat is for 12 hour clock time and "HH" is for 2 digits of 24 hour clock time.
    EDIT: Also, you're just parsing the string into a Date object. When you're printing, it'll simply use the toString() for Date, giving you an output as you see. If you want the output also to be formatted in the same way, you need to use the format() method of SimpleDateFormat with the same pattern on the Date.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    Edited by: nogoodatcoding on Oct 3, 2007 6:03 PM

  • Design flaw in blackberry pearl 8220 audio (voice) - does every phone shipped have this problem?

    Hi,
    have a new blackberry 8820 pearl that I am happy with.
    The phone does have one big problem.  hearing a person over the phone (i.e.. The top speaker embedded in the flip not the microphone in the phone case proper).
    When someone raises their voice a little during conversation the phone distorts the incoming audio (it makes a tinny sound like when a speaker distorts when it is overloaded and yes I am using default volume and have tried it on all volume levels... The phone speaker still distorts incoming voice).
    Also called a few numbers and got several people's voicemail announcement... Because people raise their voice just a little bit when they put in their voice mail announcement the phone always distorts the voicemail greeting.
    Moved my sim card to a Motorola razor v8.  everything is crystal clear hearing and speaking.  your blackberry pearl flip has a hardware or firmware design flaw... It distorts incoming conversation based on how the person is speaking not just when they are talking with a strong clear voice... But when the incoming speech volume is raised slightly!.
    I asked tmobile to send me a new phone.  they did and the new phone does the same thing (i.e.. The handset speaker).  the speaker phone function works just fine and does not distort conversation.
    Is this a problem with a certain production run on the phone or does it happen with every blackberry pearl flip 8220?
    since the Motorola razor works fine under the same conditions with <no> distortion figured it may be design flaw going to production on the phone. But thought I would ask anyway.. In case this problem has been solved by development in-house.
    Please pass this message to engineering and the product line manager responsible for the blackberry flip 8220.  I know if I was a product manager I wouldn't want to go to market with a phone that distorts audio.  you guys should have checked the competition (Motorola and other windows CE phones to make sure the audio on the blackberry pearl is as good or better than the competition).
    Hope this helps.  please pass this forward and see what engineering and product management says.  if its a general design flaw it would be good to know.  just wanted my new blackberry (which I like) to work just as good as my Motorola razor.  both are good phones but the audio handset speaker distortion is somewhat of a pain.
    Thank you,
    mark bramblett
    EDIT: Removed personal information

    Hey pawan_vajs79,
    Welcome to the BlackBerry Support Community Forums.
    With the data you're seeing under status would mean that this device was used before, by a different customer or client.
    -ViciousFerret
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Like! for those who have helped you.
    Click  Accept as Solution for posts that have solved your issue(s)!

  • Problem with timers in a udp state pattern

    Hi.
    As a project on my school, i have created a bomberman game, that supports up to 4 players on a network. And it works fine, when there is no network timers involved, that means no packet loss handling.
    The network part of the game, is build up by UDP, to make the application support multicast. The game session flow, is build up by states which are designed like an extended 2 phase commit pattern.
    That means, the server sends Gameinfo to the clients. Then all the cliens replies with an ACK.
    The server then sends ExecuteGameinfo. Then the clients replies with an ACK.
    The server sends/requests playerinfo, and the clients reply with player info. (the server uses the player info to create gameinfo).
    These 3 states, continues to go on, as long as the game is running. And without timers, it is working great.
    But what if a packet is lost? (on a LAN, packetloss is very rare, but for the sake of my project�s issue, custom made reliability in UDP, I have to face the problem). Then the server would just hang, and wait for the client reply.
    To avoid that, i want to use a timer. If the server havent got any reply for like a 100 ms., the server should resend the package.
    And now to the actual problem :)
    Ive tried using java.util.Timer, and javax.swing.Timer. But both timers does not work in my case. Its like:
    Server starts timer.
    Server sends Gameinfo.
    100 ms passes.
    Server resends Gameinfo.
    Server restarts timer.
    100 ms passes.
    (this goes on for 5 times, and then the client is kicked)
    Server receives ACK.
    Server receives ACK.
    Server receives ACK.
    Server receives ACK.
    Server receives ACK.
    On the client side it looks like this:
    Recieves Gameinfo, replies with ACK
    Recieves Gameinfo, replies with ACK
    x 5
    So its like the server is to concentrated on that timer (even though it runs as a thread), so i doesent notice the incoming packets, that eventually stacks up, and is handled after the timer tasks are done.
    And this is exactly the problem that is described in the Timer api: " Timer tasks should complete quickly. If a timer task takes excessive time to complete, it "hogs" the timer's task execution thread. This can, in turn, delay the execution of subsequent tasks, which may "bunch up" and execute in rapid succession when (and if) the offending task finally completes."
    Ive tried using a homemade timer, with a Thread.sleep(), it is a bit better, but the problem is the same. 1 out of 20 incoming packets, is "ignored" by the server.
    I really hope any of you can help.
    I havent included any code, it would be to much code. But if you are interested in looking at something i can easily paste it.
    Thank you very much for your time :)
    Regards.

    Don't use a Timer, use DatagramSocket.setSoTimeout(). Then your receives will only block for that amount of time, throwing SocketTimeoutException if no datagram arrives.

Maybe you are looking for

  • Report for purchase requisition, purchase order and schedulling agreement.

    Hi, thanks for your help. I need a report or query just to view in one screen the related docs. as purchase requisition, purchase order and schedulling agreement. I don´t know if there is a table or trx. with that information. Is it possible to get t

  • Outlook hotsync with Desktop

    I am having a problem getting my Palm TX to hotsync with my P.C.  The process goes well until it gets to the calendar. At that pint it stops. JAG Post relates to: Palm TX

  • Numbers Will Not Sort

    I am a previous Excel user and had no problem sorting columns. I have been using Numbers for a month now and can't seem to accomplish this on my spreadsheets. I am following instructions but nothing happens, except for a bell I hear after hitting the

  • What happened to GUI development in Sun Studio 12

    Sun Studio 11 had xdesigner more/less integrated with it so you could develop windows (gui) apps. I cannot find anything in SunStudio 12 to enable me to develop C++ gui apps. Even netbeans doesn't seem to be integrated with sunstudio and has to launc

  • BDC for deliting delivery

    hi All,    I am writing a BDC for removal of outbound delivery from manifest as **--Record the BDC for deleting deliveries from Manifest         REFRESH bdcdata.         CLEAR   bdcdata.         REFRESH messtab.         PERFORM bdc_dynpro      USING