• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

works on WinXP jdk 1.6 but not Linux jdk 1.5

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear friends, why won't this code resizing a GIF image work on Linux with JDK 1.5? It works well on WinXP with JDK 1.6. On Linux it just produces an empty thumbnail image.

[ May 03, 2008: Message edited by: Niklas Rosencrantz ]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

If it is a headless Linux server...
 
Sheriff
Posts: 22821
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This shows you why should never ignore any exception unless you are 100% sure it will not occur. In that case, you should document WHY it will not occur; not only for other programmers to read, but also for yourself months later.

In any case where the exception might (or will) occur, at least print its stack trace.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rob Prime:
This shows you why should never ignore any exception unless you are 100% sure it will not occur. In that case, you should document WHY it will not occur; not only for other programmers to read, but also for yourself months later.



At work, we even don't ignore those exceptions. We "document" them by throwing an UnreachableCodeReachedException (which is a runtime exception), and sign it with our initials:

 
Marshal
Posts: 80212
423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
UnreachableCodeReachedException?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about ThisWillNeverHappenIPromiseException?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
throw new RuntimeException("Help me");
 
Campbell Ritchie
Marshal
Posts: 80212
423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At the risk of being transferred to Meaningless Drivel, throw new TheChequesInThePostException();
 
Niklas Rosencrantz
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
catch(AvoidingTheQuestionException){
Actually, Linux with JDk 1.5 doesn't seem to support GIF writing in the standard libraries. I must upgrade to 1.6 or use third party library.
 
Die Fledermaus does not fear such a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic