File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

(String) casts in SortNames

 
Peter Gragert
Ranch Hand
Posts: 424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My environment is too stupid to make distinction between
casts and identifiers.
So I got "( String ) object" by 'beautifying' and got nitpicked a number of times.
So do not do that, read the style guide again!
 
Paul Ralph
Ranch Hand
Posts: 313
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You aren't allowed to make casts from Object to String?
Paul R
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can cast an Object to a String if the Object was originally a String that was stored as an Object.
 
Peter Gragert
Ranch Hand
Posts: 424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I meant is: '(String)object' versus '( String ) object'
Styleguide conformance, you see three spaces? ;-)
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand,
  • (String)object <- the nitpickers way ?
  • ( String ) object <- your way ?

  • The first one is correct, see 2.2 - Spacing

    This is true. -- Marilyn


    [This message has been edited by Johannes de Jong (edited June 01, 2001).]
    [This message has been edited by Marilyn deQueiroz (edited June 01, 2001).]
 
Michael Pearson
Ranch Hand
Posts: 351
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to the style guide (and Marilyn reminding me) I learned this lesson.
Now that I use the style guide format it makes it a lot easier to spot a cast in my code.
Michael
 
Peter Gragert
Ranch Hand
Posts: 424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Michael,
You mean a regular expression: '(\w+)' (emacs)?!
No answer necessary.
Have a nice weekend
Peter
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic