The substitution of hashCode and equals methods

In the example below, it displays 'true' when the child objects and b are different. That I should overide equals and hashCode method for each class that extends the person?

public class EqualsTest {
     public static void main(String[] args){
          
          Child a = new Child("Tom",10,1);
          Child b = new Child("Tom",10,2);
          System.out.println(a.equals(b));
          
          
     }
}

class Person{
     private String name;
     private int height;

     private volatile int hashCode = 0; 

     
     public Person(String n, int h){
          this.name = n;
          this.height = h;
     }
     
     @Override
     public boolean equals(Object obj) {
          if(this == obj){
               System.out.println("hello");
               return true;
          }
          if(obj instanceof Person){
               Person a = (Person)obj;
               if(this.name.equals(a.name)){
                    return true;
               }else{
                    return false;
               }
          }else{
               return false;
          }
     }
     
     @Override
    public int hashCode () { 
        final int multiplier = 23; 
        if (hashCode == 0) { 
            int code = 133; 
            code = multiplier * code + name.hashCode(); 
            code = multiplier * code + new Integer(height).hashCode(); 
            hashCode = code; 
        } 
        return hashCode; 
    } 

}

class Child extends Person{
     
     private int age;
     
     public Child(String n,int h,  int a) {
          super(n,h);
          this.age = a;
     }
}
Thank you

It is not "optimal", it is by definition the keys are unique. But what is unique? This means that any equal 2 keys do exist in the table and means 'equal' some equals() defines as equal.

Published by: baftos on April 18, 2011 13:25

Tags: Java

Similar Questions

  • HashCode() and equals() overrideing

    This is related to my previous post. I followed the advice that was given to me. I overrode equals() and hashcode()
    public class TwoTuple<A,B>{
         
         public final A first;
         public final B second;
         
         public TwoTuple(A a, B b){
              first = a;
              second = b;
         }
         
         public boolean equals(TwoTuple tt){
            return first.equals(tt.first);
         }
         
         public int hashCode(){
              return 31 * first.hashCode();
         }
         
         public String toString(){
              return "Variable == " + first + "  Value == " + second;
         }
    }
    Test class:
    import java.util.*;
    
    public class Test{
    
         private static Set<TwoTuple> state = new HashSet<TwoTuple>();
         
         public static void main(String[] args){
              state.add(new TwoTuple<String,Boolean>("Testing", true));
              state.add(new TwoTuple<String,Boolean>("Testing", true));
              state.add(new TwoTuple<String,Boolean>("Testing", true));
              
              for(TwoTuple tt : state){
                   System.out.println(tt);
              }
                   
              TwoTuple tt = new TwoTuple("Testing", true);
              System.out.println("Equals == " + tt.equals(new TwoTuple("Testing", true)));
              System.out.println("Equals == " + tt.equals(new TwoTuple("Hello", true)));
              System.out.println("Equals == " + tt.equals(new TwoTuple("abc", true)));
              
         }
    }
    Exit;
    Variable == Testing  Value == true
    Variable == Testing  Value == true
    Variable == Testing  Value == true
    Equals == true
    Equals == false
    Equals == false
    I'm still train 3 elements that are identical within my game. What I am doing wrong?

    A pitfall that is a delicate issue.
    You have not actually overridden equals().

    The equals method signature is:

    public boolean equals(Object o)
    
  • Can MapPoint 2011 - be installed without the substitution of previous versions?

    I need to be able to keep older versions of MapPoint on my laptop while having access to 2011.  I could install 2009 without the substitution of 2004 and 2006, but my IT people say it cannot be done with 2011.  Can he?

    Hello

    Check with the help of MapPoint and in the MapPoint Forums.

    Highway, Streets & Trips, MapPoint - Forum
    http://social.Microsoft.com/forums/is/streetsandtrips/threads

    MapPoiint - Support
    http://www.Microsoft.com/MapPoint/en-us/support.aspx

    Support for MapPoint, streets & trips and Highway
    http://support.Microsoft.com/ph/851

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Admin Console - requires that the user Admin password and user name valid

    I am running FMIS4.5 on CentOS5.5

    FMIS runs and I can connect via Flash Media Encoder.

    Displays and Web administration console: 1111 gives the xml output, however

    During the use of the user and the password in my xml files to connect (tests with ping), I get the error "user Admin password and valid user name required.

    conf/FMS.ini:

    ###########################################################################

    # fms.ini contains alternative to Flash Media Server variables #.

    # the configuration files. Lines beginning with ' # ' are considered comments.  #

    # A variable substitution is in the form < name > = < value >. All the way to #.

    # the first '=' is considered the substitution variable name and #.

    # everything after the first '=' is considered the substitution value. If #.

    # you want a substitution variable to have beginning or trailing spaces.

    # include double quotes around the value. For example, foo ="bar" #"

    ###########################################################################

    ###############################################################

    # This section contains configurable settings in the Server.xml file #.

    ###############################################################

    # Username admin server

    # For example:

    # SERVER. ADMIN_USERNAME = foo

    #

    SERVER. ADMIN_USERNAME = Admin

    SERVER. $admin_password = str34m1ng

    # Port and Flash Media Admin Server IP address must listen to

    # For example:

    # SERVER. ADMINSERVER_HOSTPORT =: 1111

    #

    SERVER. ADMINSERVER_HOSTPORT =: 1111

    # User Id in which to run the process (Linux only)

    # For example:

    # SERVER. PROCESS_UID = 500

    #

    SERVER. PROCESS_UID = 500

    # GID in which to run the process (Linux only)

    # For example:

    # SERVER. PROCESS_GID = 500

    #

    SERVER. PROCESS_GID = 500

    # Key license for Flash Media Server

    # For example:

    # SERVER. LICENSEINFO = XXXX-XXXX-XXXX-XXXX-XXXX-XXXX

    #

    SERVER. LICENSEINFO = #SORRY YOU DON'T GET TO SEE THIS #.

    # LIVE_DIR is the full path of the sample application 'Live '.

    folder # to store any live streams recorded by the server.

    # For example:

    # LIVE_DIR = \applications\live < FMS_Installation_Dir >

    #

    LIVE_DIR = / opt/adobe/fms/applications/live

    # VOD_COMMON_DIR is the full path to the sample application "VOD".

    folder # to the storage on demand and progressive download of fichiers.flv/.mp3.

    # File stored in this folder can be listened to and are also available PD.

    # Note: If you use the installation default Apache as a Web server.

    # If you change VOD_COMMON_DIR and please change the document root

    # in the httpd.conf file accordingly.

    # For example:

    # VOD_COMMON_DIR = \webroot\vod < FMS_Installation_Dir >

    #

    VOD_COMMON_DIR = / opt/adobe/fms/webroot/vod

    # VOD_DIR is the full path to the sample application "VOD".

    folder # to store only the fichiers.flv/.mp3 on request. Files stored in

    # This file are not PD-able

    # For example:

    # VOD_DIR = \applications\vod\media < FMS_Installation_Dir >

    #

    VOD_DIR = / opt/adobe/fms/applications/vod/media

    # The maximum size of the FLV cache, in megabytes.

    # The default is 500 MB.

    #

    SERVER. FLVCACHE_MAXSIZE = 500

    # To start and stop the server HTTP included throughout

    # with FMS.

    #

    SERVER. HTTPD_ENABLED = true

    ################################################################

    # This section contains configurable settings in Adaptor.xml #.

    ################################################################

    # Application to the virtual host directory

    # For example:

    # VIRTUAL SERVER. APPSDIR = C:\myapps

    #

    VHOST. APPSDIR = / opt/adobe/fms/applications

    VHOST. ALLOW all =

    ####################################################################

    # This section contains configurable settings Application.xml #.

    ####################################################################

    # List of semicolon delimited paths of research for loading script

    # For example:

    # APP. JS_SCRIPTLIBPATH = C:\scripts; C:\Program Files\Foo\scripts

    #

    APP. JS_SCRIPTLIBPATH = / opt/adobe/fms/scriptlib

    ###############################################################

    # This section contains configurable settings in Logger.xml #.

    ###############################################################

    RECORDER. LOGDIR =

    ####################################################################

    # This section contains configurable settings in Users.xml #.

    ####################################################################

    # Enable or disable using HTTP requests to run admin commands.

    # The value "true" to enable, otherwise it will be disabled.  The

    actual orders # allowed for the server admin and admin of the virtual host

    # users can be defined in Users.xml.

    USERS. HTTPCOMMAND_ALLOW = true

    Users.XML:

    < root >

    < UserList >

    <!-this tag defines a server administrator. ->

    < username = ' ${SERVER.» ADMIN_USERNAME} ">"

    <!-salted Hash of the password for the administrator of the virtual server. ->

    < password encrypt = "false" >$ {SERVER. $admin_password} < / password >

    <!-this administration cannot connect to the server of the-> specified

    <!-hosts. This is specified as a comma-delimited list.

    <!-host names or domain names and/or (full or partial) IP->

    <!-addresses. For example,-->

    <!-"foo.yourcompany.com, macromedia.com, 10.60.1.133, 10.60" - >

    <>allow all < / allow >

    <!-this admin is unable to connect to the server from all the...

    <!-specified hosts. This is specified as a list by commas->

    <!-the name of host or domain names and/or IP (full or partial) - >

    <!-addresses. For example,-->

    <!-"foo.yourcompany.com, macromedia.com, 10.60.1.133, 10.60" - >

    < deny > < / nie >

    <!-specifies the order in which evaluate < Allow > and ->

    <!-< Deny > tags. This can be 'Allow, Deny' or 'Deny, Allow '. The - >

    <! - default is 'Deny, Allow', which means that access is allowed - >

    <!-unless specified in < Deny > < Allow > and not.     ->

    < order > allow, deny < / order >

    < / user >

    < user name "janedoe" = >

    < password encrypt = "false" > S4mpl3P4ss < / password >

    allow <>< / allow >

    < deny > < / nie >

    < order > allow, deny < / order >

    < / user >

    < / UserList >

    < AdminServer >

    < HTTPCommands >

    <!-turn on or off using HTTP requests to run admin commands.     ->

    <!-set "true" to enable, otherwise it will be disabled.  The - >

    <! - actual orders allowed for server admin and admin of the virtual host - >

    <!-users can be defined in allow it and deny elements.                                   $

    < activated >$ {USERS. HTTPCOMMAND_ALLOW} < / activate >

    <!-list orders admin server accessible through HTTP.         ->

    <!-add several commands separated by commas.  'All' indicates->

    <!-all orders (it is not recommended to allow orders).          ->

    <!-Separate multiple commands with commas.                              ->

    Ping < Allow > < / allow >

    <!-list of orders admin server refused access via HTTP.                ->

    <!-add several commands separated by commas.  'All' indicates->

    <!-all orders.                                                       ->

    < deny > all < / deny >

    <!-processing order for refuse and allow command lists.  'Deny, allow' - >

    <!--means that the command will be permitted if the order is allow-->

    <!-list or not in the deny list.   'Allow, Deny' means the--> command-line

    <!-will be allowed if it is in the allow list and not in the - >

    <!-list of deny.                                                           ->

    < order > deny, allow < / order >

    < / HTTPCommands >

    < / AdminServer >

    < / root >

    Exit the: admin/1111/ping? auser = Admin & apswd = str34m1ng:

    < result >

    errorof the < level > < / level >

    < code > NetConnection.Connect.Rejected < code >

    < description > Admin user requires valid user name and password. < / description >

    < timestamp > Thursday, May 17, 2012 11:33:43 AM EDT < / timestamp >

    < / result >

    Links do not work for localhost and external connections and the fms_adminConsole.htm (.swf) fails as well.

    Any help is appreciated!

    Hey Jon,

    Please take a look at this. Should help.

    http://forums.Adobe.com/message/4346847#4346847

    Thank you.

  • Equal method and ArrayList Testing

    Hello world

    Here is an example of program...

    List ListOB1 = new ArrayList();
    listOB1.add (100);
    listOB1.add (200);
    Integer intOB1 = new Integer (200);

    for (Object o: listOB1) {}
    If (OB. Equals (intOB1))
    System.out.println ("Hi... Elements is: - > "+ ob);
    on the other
    System.out.println ("elements is: - >" + ob);
    }

    It shows the output «Elements is: - > 100 Hi...» Elements is: - > 200 ".» My question is: when dealing with 200 members by using the equals() method it is true how?

    Because the default equals() methods check reference everything 'ob' and 'intOB1' has a different reference. Then how he evaluates to true in the case of the if() function tests.

    Thanks in advance...

    793463 wrote:
    Here the equals() method called Type a, no Type of B.

    Once again: why?

    Both the static type of ob1 and the type of the object referenced by this is A. Why should he call a method other than A.equals ()?

  • We tried the window. ResizeTo and window. Methods MoveTo using javascript. It doesn't seem to work in version 9.0.1. Please suggest any alternative.

    Hello
    We tried the window. ResizeTo and window. Methods MoveTo using javascript. It doesn't seem to work in version 9.0.1. Please suggest any alternative.

    Thank you
    Avinash

    This is no longer allowed for security reasons (bug 565541).

    See https://support.mozilla.org/nl/questions/880032

    https://developer.Mozilla.org/en/DOM/window.MoveTo

  • Is there a method to determine the Anyconnect client types and quantities that connect to the ASA sslvpn?

    We need to determine the distribution of different Anyconnect sslvpn, connecting clients to our ASA hub. Is there a method, either in the ASDM or CLI (or syslog) to determine the type of customer and the meter (for example the Android and iOS vs Windows vs Linux)?

    There are 'user agent' field in vpn-sessiondb. You can check via ASDM or

     show vpn-sessiondb det anyconnect

    If my memory is good. (Exact symptom depends on version)

    http://www.Cisco.com/c/en/us/TD/docs/security/ASA/ASA-command-reference/...

  • Problem with transmission of the data in table between a driver and a method.

    I'm having a problem with a project for school. We want to take the data in a table, we create in our driver, pass it to the method, do something for her and return the data to the driver. Well, I still get the same error message and after looking at dozens of sites, it seems that I think that I have the correct code... but I still get the same error message. Here is the error message that I've been doing.
    * ola1driver.java:35: get() in ola1method may apply to (char [] [])
    x.get (Dar);
    (upwards arrow pointing between x and get) *.

    I'd appreciate any help I'm leaving research to simply looking at my code to try to find the error. My wife things I'm going nuts at the moment.

    Here are my two files, the first is the driver and the second method

    Take a 2D array and send the data to a method, and then put it back
    import java.util.Scanner;
    class ola1driver
    {
    Public Shared Sub main (string args [])
    {
    Entrance to the parser = new Scanner (System.in);
    ola1method x = new ola1method();
    Char [] [] dar = new char [10] [100];
    char dat_input;

    Set up the loop at the entrance a table of 10 x 100 with data imported from a dat file
    for (int i = 0; i < 10; i ++)
    {
    for (int j = 0; j < 100; j ++)
    {
    dat_input = input.next () .charAt (0);
    Dar [i] [j] = dat_input;
    }
    }
    Send the array to the method and displays the original table to compare the return data
    x.Set (Dar);
    for (ip int = 0; ip < 10; ip ++)
    {
    for (int jp = 0; jp jp; < 100 ++)
    {
    System.out.printf ("%n", dar [ip] [jp]);
    }
    }

    To get the data of the method and then print the data in the table opposite
    x.get (Dar);

    for (int r = 0; r < 10; r ++)
    {
    for (int c = 0; c < 100; c ++)
    {
    System.out.printf ("%n", dar [r] [c]);
    }
    }
    }
    }

    Now the method;

    Method to receive a 2D painting, reverse the data and then put it back
    class ola1method
    {
    Char [] [] ar = new char [10] [100];
    Char [] [] rar = new char [10] [100];

    public void set (char [] [] ar)
    {
    / * To reverse the entries in the table
    to prove that real return
    data was transferred between the driver
    and the method * /
    IR int = 0;
    for (int i = 9; I have > 0; i-)
    {
    for (int j = 100; j > 0; j-)
    {
    int jr = 0;
    RAR [ir] [Jr.] is ar [i] [j];.
    Jr ++;
    }

    IR ++;
    }
    }
    Return the data to the driver
    public char [] [] get()
    {
    return of rar;
    }
    }

    Published by: Seamus on February 20, 2011 08:25

    Published by: Seamus on February 20, 2011 08:26

    Seamus wrote:
    I thought that I sent my method by using the x.set table, and then by calling the reversed with the x.get table.

    x.Set (someArray) in fact to 'send an array to the method '.

    And if x.get () is declared to return an array, then, Yes, it indeed 'retrieve a table. "

    However, these are two completely different methods. The get method doesn't know something on the table sent via the set method unless the game puts a place who knows himself. For example, something like this:

    public class X {
      private int[] arr;
    
      public void set(int[] arr) {
        this.arr = arr;
      }
    
      public int[] get() {
        reverse arr and return it
      }
    }
    
    public class Main {
      public static void main(String[] args) {
        int[] arr1 = {1, 2, 3};
        X x = new X();
        x.set(arr);
        int[] arr2 = x.get();
      }
    }
    

    However, this seems a bit unusual. It is not clear from your initial post, but looks like it is supposed to be a single method that takes the array and it reverses. If so, you could either simply invert the table and returns nothing, since the variable of the appellant and the parameter of the method will all be pointing to the same table object, or you could return a reference to the table that you have received and reversed, or you can copy the table, reverse the copy and return a reference to that.

    I don't know what your needs are, but the point is that it is more common to call a single method to do something like that, rather than separate set() and get() methods.

    Edited by: jverd February 20, 2011 09:36

    Edited by: jverd February 20, 2011 09:37

  • the two equii join and natural join are equall.will both display the output of the same

    the two equii join and natural join are equall.will both display even

    output?

    Hello
    It keeps you a little test and check yourself?

    See the link below.

    http://psoug.org/reference/joins.html

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> CREATE TABLE parents (
      2  person_id  NUMBER(5),
      3  adult_name VARCHAR2(20),
      4  comments   VARCHAR2(40))
      5  PCTFREE 0;
    
    Table created.
    
    SQL>
    SQL> CREATE TABLE children (
      2  parent_id    NUMBER(5),
      3  person_id    NUMBER(5),
      4  child_name   VARCHAR2(20),
      5  comments     VARCHAR2(40))
      6  PCTFREE 0;
    
    Table created.
    
    SQL>
    SQL> INSERT INTO parents VALUES (1, 'Dan', 'So What');
    
    1 row created.
    
    SQL> INSERT INTO parents VALUES (2, 'Jack', 'Who Cares');
    
    1 row created.
    
    SQL> INSERT INTO children VALUES (1, 2, 'Anne', 'Who Cares');
    
    1 row created.
    
    SQL> INSERT INTO children VALUES (1, 1, 'Julia', 'Yeah Right');
    
    1 row created.
    
    SQL> INSERT INTO children VALUES (2, 1, 'Marcella', 'So What');
    
    1 row created.
    
    SQL> COMMIT;
    
    Commit complete.
    
    SQL>
    SQL> SELECT adult_name, child_name
      2  FROM parents NATURAL JOIN children;
    
    ADULT_NAME           CHILD_NAME
    -------------------- --------------------
    Jack                 Anne
    Dan                  Marcella
    
    SQL> select adult_name,child_name from parents a, children b
      2  where a.person_id=b.person_id;
    
    ADULT_NAME           CHILD_NAME
    -------------------- --------------------
    Jack                 Anne
    Dan                  Julia
    Dan                  Marcella
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  select adult_name,child_name from parents a, children b
      2* where a.person_id=b.parent_id
    SQL> /
    
    ADULT_NAME           CHILD_NAME
    -------------------- --------------------
    Dan                  Anne
    Dan                  Julia
    Jack                 Marcella
    
    SQL>
    

    Kind regards
    Avinash

  • Passing data between the component main enforcement through custom methods and custom

    Similar to what this article is talking about, I have a custom list that contains a list of names of State of the United States in chains. (Let's call this states.mxml) #comments http://www.boyzoid.com/blog/index.cfm/2006/11/22/Flex-Custom-Components-and-Custom-Methods

    I create an action script that is included in my states.mxml like < mx:Script source = "myScripts.as" / > so that I can call the method in mySpcripts.as

    Now, what I want to do is, whenever I click on an item in the list, I want this string is displayed on the Application of the hand (on a canvas or Panel) as a label.

    I don't know how I am supposed to refer to the canvas and wood, which lies on the main of the application of myScripts.as
    Is there a way to create an action script file where methods can reference components for the main application and the custom component file?

    Thank you

    this.parentApplication.canvas.label should do what you are looking for

  • The matching blue screens and random reboots/crashes.

    Greetings. A year ago, I built a new computer, including the following parts:

    AMD Athlon 64 Dual Core 89W

    Motherboard ASUS M3A78 Pro

    Seagate Barracuda 7200.10 250 GB Sata internal HD

    4 GB of Ram DDR2 (not sure of the speed/brand)

    Since installing windows, I started getting blue screens of various types. Here are some blue screens I have met:

    Interrupt Unhandled Exception, failure of Page in the paginated, computer space made an attempt to write to read only memory, Memory_Management, IRQL not less or equal and Driver IRQL not less or equal. When these blue screens occur, some remain on the screen, while other flick on briefly and the computer begins to restart.

    On top of these blue screens, I also sound experience breaks down in loop in games. These experiences are breakers occur anywhere from 5 minutes to more than two hours of play.

    In the first dealing with this issue, I decided to test the memory with memtest86. A test actually froze on me. A second test showed no problems. Because of the freeze, I took a bit of ram to see if there could be a problem with some of the sticks is bad. Low and here are the problems disappeared. For a period of time. Some games have kept crashing on me, while others have worked without a hitch. I will mention that a game (World of Warcraft) seems to have more memory than others still ran without encountering any problem later.

    Because of all the questions, I decided to reformat/reinstall windows to make sure that everything has been installed correctly. Right out of the door, it began freezing at all normal intervals.

    I have this post is because I am curious about how of course, I can be that these problems are caused by a single hardware issue (I think I'm the ram). I ask because DDR2 Ram is cheaper and my motherboard will not support DDR3. However, if I buy the overvalued price DDR2 and it does not solve the problem, then it ends up being a pretty big money sink.

    Any guidance would be greatly appreciated.

    Hello

    Check this thread for more information on using BlueScreenView, MyEventViewer and other methods
    to troubleshoot the BlueScreens - first two responses.

    http://social.answers.Microsoft.com/forums/en-us/vistahardware/thread/8cd8362e-7d06-46FB-afd7-84d54b6a8ea7

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • The substitution of controller on HR Self Service salary Page

    Hello

    I am very new to the OFA, and one of our users asked us to do a required field. The name of the field is reason for change in salary. They do not want this customization, and that's why I ended the substitution of the controller. The controller checks the value of this field on the button apply on ProcessFormRequest. If the value is empty, the controller should trigger just an OAException. Everything works fine except the value of the reason to pay is not sent to the review page and after committing, the value does not appear in the database. Another strange thing is that if I Uncomment super.processFormRequest (oapagecontext, oawebbean); statement as the first line of the PFR, the value is passed successfully, but my validation of Virgin pay reason does not occur. That of why I wrote the Super in the else statement and commented on one. But with this code, the value of the reason for the compensation is not passed. Any help is appreciated. Here is the code:

    SerializableAttribute public class XXPERProposedPayCON14 extends ProposedPayCO {}

    public XXPERProposedPayCON14() {}

    }

    public void processFormRequest (OAPageContext oapagecontext,

    {OAWebBean oawebbean)

    super.processFormRequest (oapagecontext, oawebbean);

    Oaapplicationmodule = OAApplicationModule

    oapagecontext.getApplicationModule (oawebbean);

    Oadbtransactionimpl = OADBTransactionImpl

    (OADBTransactionImpl) oaapplicationmodule.getOADBTransaction ();

    String oafuncvalue = "";

    If (oapagecontext.getTransactionValue ("PER_OAFUNC_VAL")! = null) {}

    oapagecontext.writeDiagnostics (this,

    (new StringBuilder()).append("oafunction_processFormRequest_is_==").append (oapagecontext.getTransactionValue ("PER_OAFUNC_VAL")) m:System.NET.SocketAddress.ToString (),.

    (1);

    oafuncvalue =

    (String) oapagecontext.getTransactionValue ("PER_OAFUNC_VAL");

    }

    If (oapagecontext.getParameter ("Apply")! = null) {}

    If (oapagecontext.getParameter ("PayReason") == "") {}

    oapagecontext.writeDiagnostics (this,

    "Inside to pay for reason is empty 1.

    (1);

    throw new OAException ("Please select a value for reason of salary change", OAException.ERROR);

    return;

    } else {}

    oapagecontext.writeDiagnostics (this,

    "Inside another reason to pay is not void 2,

    (1);

    super.processFormRequest (oapagecontext, oawebbean);

    HashMap hashmap2 = new HashMap (3);

    hashmap2.put ("PER_TRANSACTION_ID",

    oadbtransactionimpl.getValue ("TX_TRANSACTION_ID"));

    hashmap2.put ("PER_TRANSACTION_STEP_ID",

    oadbtransactionimpl.getValue ("TX_TRANSACTION_STEP_ID"));

    hashmap2.put ("FROM_INTERNAL_FLOW", "Y");

    hashmap2.put ("OAFunc", oafuncvalue);

    oapagecontext.setForwardURL ("OA.jsp?page=/oracle/apps/per/selfservice/deployperson/webui/AssignmentPG",

    NULL, (byte) 0, null, hashmap2,.

    true, ', (byte) 0);

    } //else

    }

    If (oapagecontext.getParameter ("Cancel")! = null) {}

    HashMap hashmap = new HashMap (1);

    HashMap.put ("FROM_INTERNAL_FLOW", "Y");

    HashMap.put ("OAFunc", oafuncvalue);

    oapagecontext.setForwardURL ("OA.jsp?page=/oracle/apps/per/selfservice/deployperson/webui/AssignmentPG",

    NULL, 0, null, hashmap, true (byte),

    ', (Byte) 0);

    }

    }

    public static final String RCS_ID =

    ' $Header: XXPERProposedPayCO.java 120.31.12010000.7 2010/03/23 10:52:38 vkodedal ship $';

    public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion ("' $Header: XXPERProposedPayCO.java 120.31.12010000.7 2010/03/23 10:52:38 vkodedal ship $',")

    "oracle.apps.per.selfservice.changepay.webui");

    }

    Hello

    They do not want this customization, and that's why I ended the substitution of the controller.

    Why? No particular reason?

    If you just want to check extra, just do this in your controller.

    Something like below:

    public class XXPERProposedPayCON14 extends ProposedPayCO {
    
      public XXPERProposedPayCON14() {
      }
    
      public void processFormRequest(OAPageContext oapagecontext,OAWebBean oawebbean) {
      oapagecontext.writeDiagnostics(this,"Inside custom Controller",1);
      if (oapagecontext.getParameter("Apply") != null) {
      oapagecontext.writeDiagnostics(this,"Inside Apply",1);
      String payReason = oapagecontext.getParameter("PayReason");
      oapagecontext.writeDiagnostics(this,"payReason:"+payReason,1);
      if ( payReason == null || "".equals(payReason) {
      oapagecontext.writeDiagnostics(this,"Inside if Pay Reason is blank 1",1);
      throw new OAException("Please Select a Value for Salary Change Reason", OAException.ERROR);
      }
      }
      super.processFormRequest(oapagecontext, oawebbean);
    
      /*
      //super.processFormRequest(oapagecontext, oawebbean);
      OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
      OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)oaapplicationmodule.getOADBTransaction();
      String oafuncvalue = "";
      if (oapagecontext.getTransactionValue("PER_OAFUNC_VAL") != null) {
      oapagecontext.writeDiagnostics(this,(new StringBuilder()).append("oafunction processFormRequest is == ").append(oapagecontext.getTransactionValue("PER_OAFUNC_VAL")).toString(),1);
      oafuncvalue = (String)oapagecontext.getTransactionValue("PER_OAFUNC_VAL");
      }
      if (oapagecontext.getParameter("Apply") != null) {
      if (oapagecontext.getParameter("PayReason") == "") {
      oapagecontext.writeDiagnostics(this,"Inside if Pay Reason is blank 1",1);
      throw new OAException("Please Select a Value for Salary Change Reason", OAException.ERROR);
      //return;
      }
      else {
      oapagecontext.writeDiagnostics(this,"Inside else Pay Reason is not blank 2",1);
      super.processFormRequest(oapagecontext, oawebbean);
      HashMap hashmap2 = new HashMap(3);
      hashmap2.put("PER_TRANSACTION_ID",
      oadbtransactionimpl.getValue("TX_TRANSACTION_ID"));
      hashmap2.put("PER_TRANSACTION_STEP_ID",
      oadbtransactionimpl.getValue("TX_TRANSACTION_STEP_ID"));
      hashmap2.put("FROM_INTERNAL_FLOW", "Y");
      hashmap2.put("OAFunc", oafuncvalue);
      oapagecontext.setForwardURL("OA.jsp?page=/oracle/apps/per/selfservice/deployperson/webui/AssignmentPG",null, (byte)0, null, hashmap2,true, "N", (byte)0);
      } //else
      }
      if (oapagecontext.getParameter("Cancel") != null) {
      HashMap hashmap = new HashMap(1);
      hashmap.put("FROM_INTERNAL_FLOW", "Y");
      hashmap.put("OAFunc", oafuncvalue);
      oapagecontext.setForwardURL("OA.jsp?page=/oracle/apps/per/selfservice/deployperson/webui/AssignmentPG",null, (byte)0, null, hashmap, true,"N", (byte)0);
      }
      */
      }
    
      public static final String RCS_ID = "$Header: XXPERProposedPayCO.java 120.31.12010000.7 2010/03/23 10:52:38 vkodedal ship $";
      public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header: XXPERProposedPayCO.java 120.31.12010000.7 2010/03/23 10:52:38 vkodedal ship $","oracle.apps.per.selfservice.changepay.webui");
    
    }
    

    See you soon

    AJ

  • Equals, method

    Hi all
    Consider this example,
    Class A {}
    Public Shared Sub main (String [] args) {}
    An a1 = new A();
    An a2 = new A();
    {if (a1. Equals (a2))}
    System.out.println ("Equal");
    } else {}
    System.out.println ("does not match");
    }
    }
    }
    I know that using the equals() method. but there is no equal method defined in the class a. also, I didn't use any library. can someone explain this?

    874474 wrote:
    I know that using the equals() method. but there is no equal method defined in the class A.

    Has, as all classes in Java, is a subclass of the object and therefore inherits all of the public methods of the object, including equals().

  • rectangle with a circle line dotted with rounded corners and equal distance

    I'm a fan of the Illustrator who needs assistance to create a rounded rectangle with a circle dotted line and also spaced circles.  any help would be greatly appreciated.  Thank you!

    If I understand what you're asking correctly, I think all you have to do is create your rectangle rounded using the rounded Rectangle tool and then apply a brush model with the 'circle dotted line. " To create the model of brush, simply use the Ellipse tool to draw a circle/point forms the same size as the points you want to make your line dotted, then drag the circle/dot to the Palette. The dialog new brush will appear when you do this. Select the new brush model, then click on 'OK '. The model brush Option dialog box will appear next. In the text spacing box, enter 100% (this will give you a space between each point equal to the same size as the dot). In addition, if you want to be able to change the colour of the points, select shades and nuances in the dropdown under the colorization of methods. (see attachment) Click 'OK' and your new brush model should now appear in your Palette of forms. All you have to do now is to select your rectangle rounded with the Selection tool and click your new brush palette forms to apply.

    If your points are bigger or smaller you want once you apply, you can change the size of the points by double-clicking on your brush pattern in the Palette forms and changing the value of the scale.

  • What is the Arch of fire and what is its function?

    What is the Arch of fire and what is it ' s function?

    Do you mean FileVault?

    If so, it is a method of encrypting the data on the hard drive to prevent access to the data by others. It is of first importance for mobile devices that take place around with you rather than office devices that tend to stay in a safer environment.

Maybe you are looking for

  • Pavilion 9220y video card update

    HelloI was hoping that an expert can help me upgrade/configure a new video card for a desktop HP Pavilion Elite 9220y. I have done the research to shed light on the issue, but would REALLY appreciate some help!So just that the machine has now integra

  • conversion of old version driver

    Hey, I need to use an instrument driver (created in version 5 LV) and I'm using LV 2014 version.  Can someone convert it to something that I can use?

  • My C3180 all in one printer will not print a full page.

    It prints the header and the bottom of the page, but the rest is empty. It's a new problem, since I used this same printer for years without any problem. Any help you can give me would be welcome.

  • Keep awake screen

    Is it possible to keep awake screen? I tried to use SCREEN_PROPERTY_IDLE_MODE with a simple application and it did not work. Code: int main (int argc, char * argv) {}int rc = 0; screen_create_context (& screen_cxt, 0); RC = screen_create_window (& sc

  • Win 10 VMware® Workstation 12 Pro upgrade to 12.0.1 or 12.1.0 keyboard and mouse freeze

    Win 10, 64-bit (Build 10586) 10.0.10586, VMware® Workstation 12.0.0 Pro all right.If I update to VMware® Workstation 12.0.1 or now VMware® Workstation 12.1.0and restart the system 10 Windows, the keyboard and the mouse freezes.There is no way to have