Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

find method in Data class

 
Miguel Roque
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.
I've been working in the reservation part of the assignment and i've seen what could be a bug in the data class. The method find in this class compares the first value using the equals (what is right), but in my case, i've created new records that i've added to the database and some of them in the first field doesn't have 5 digits as in the original database. Like this, the method find doesn't work.
I've changed the line

to be

Has anyone done this? Is it realy necessary? Well, we can allways argue this in the design choices file !
Thanks,
Miguel
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Miguel,
I guess most people (as I have ) would just trim the values on the presentation of the data on the GUI i.e on the View
as well as on any equality checks between the View and the Model.
I think that's right. As far as Internationalisation goes, I should think trailing spaces meaning nothing is pretty Universal.
regards
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!