Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Java converting Date to 100 years back

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am pretty new to Java. I had worked on Java a bit around 12 years ago, so please bear with any stupid questions.

We have a Project which is in house built for ETL Purpose. Unfortunately the Developer isnt with organization anymore and now the responsibility has come upon me.

The issue we are facing is whenever the Input date is format "DD-MON-YY" ex "10-Mar-21" the Java is converting the date to "1921-03-10 00:00:00.000"

The flow of Project is we provide a SQL Query which is used to read data from a source database
Select column1 from table1

The few processing's are done and then a SQL Statement is prepared to insert into destination database
Insert into DestTable1(Column1)
Values('1921-03-10 00:00:00.000')

I think whenever the Year is supplied in two digits we are facing this issue.

Can anyone please let me know what might be the reason for this 100 years back conversion and where can i look in code for this and what would i have do to fix this?

Many thanks in advance.
 
Marshal
Posts: 26520
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Manju!

So... you get input in the form of a String, and then...? My guess is that you convert that String to a Date, and then you put that date somehow into an SQL INSERT statement, but I'm not even going to guess how.

But you're getting the input date from a database, in which case converting that date to a String would be a bad idea. Unless you need to use it in String form for some reason.

As you can see, I'm not giving you any good answers based on guessing. If you need help with the code then post it here.
 
Paul Clapham
Marshal
Posts: 26520
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And yeah, two-digit years can be a pain. I spent four years of my life in the last century fixing my company's computer systems so they didn't do that.
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:Welcome to the Ranch, Manju!

So... you get input in the form of a String, and then...? My guess is that you convert that String to a Date, and then you put that date somehow into an SQL INSERT statement, but I'm not even going to guess how.

But you're getting the input date from a database, in which case converting that date to a String would be a bad idea. Unless you need to use it in String form for some reason.

As you can see, I'm not giving you any good answers based on guessing. If you need help with the code then post it here.



Hi Paul,

You were very much right.

The source column in Database is Varchar, so they enter values in whichever format they feel like which definitely should be avoided but no ones even thinking about it.
The Destination column we have made it as Datetime

I have no idea what piece of code does this and where does this conversion takes place. I learnt how to start debugging on weekend and trying to replicate issue in lower environment. So as soon as i figure out where it is i will post the code
 
Paul Clapham
Marshal
Posts: 26520
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Manju Bhat wrote:The source column in Database is Varchar, so they enter values in whichever format they feel like which definitely should be avoided but no ones even thinking about it.



Arrrgggghhh. If your designers did that then chances are the Java code is equally awful. Good luck tracking down the guilty code, though. There's a way to work with 2-digit years by specifying a 100-year "window", e.g. from 1970 to 2069, and using standard Java classes to parse them. But I have a bad feeling that other more "creative" ideas have been employed.
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:

Manju Bhat wrote:The source column in Database is Varchar, so they enter values in whichever format they feel like which definitely should be avoided but no ones even thinking about it.



Arrrgggghhh. If your designers did that then chances are the Java code is equally awful. Good luck tracking down the guilty code, though. There's a way to work with 2-digit years by specifying a 100-year "window", e.g. from 1970 to 2069, and using standard Java classes to parse them. But I have a bad feeling that other more "creative" ideas have been employed.



I finally found the piece of code which actually writes to destination database. But i am still unable to go inside these methods and pin point where exactly the converting is taking place

for (Integer threadNum = 1; threadNum <= job.getThreadCountMax(); threadNum++ ) {
threadCnt.incrementAndGet();
threadCntEnded.incrementAndGet();
WriteThreadTask writeThreadTask = new WriteThreadTask(threadNum);
writeThreadTaskList.add(writeThreadTask);
Runnable writeThread = new WriteThread(job,bQueue,writeThreadTask);
new Thread(writeThread).start();
}
 
Paul Clapham
Marshal
Posts: 26520
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, that code just submits a number of threads. Somewhere inside the WriteThreadTask is where you're going to find the database code.
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:No, that code just submits a number of threads. Somewhere inside the WriteThreadTask is where you're going to find the database code.



thanks Paul

I am going through each piece of code inside writethreadtask as soon as i find anything related to date or convert something i will update here
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think i found it. I didnt find where exactly this is being called but saw this class and believe this is where that conversion is happening as my input format contain "-"

This is the piece of code i found. I might be wrong too

else if (date.contains("-"))  {
/* test yyyy-MM-dd and MM-dd-yyyy
26-Apr-16
*/
try {
String[] dateAry = date.split("-"); //Check dd-MON-yy
if (dateAry[1].matches("(?i)jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|january|febuary|march|april|may|june|july|august|september|october|november|december")){
Integer year = yearCheck(Integer.parseInt(dateAry[2]));
Integer day = dayCheck(Integer.parseInt(dateAry[0]));
Integer month = month2Int(dateAry[1]);
if (!dateCheck(year,month,day)) {
return badDate;
}
newStr = year + "-" + month + "-" + day;
} else { //Check yyyy-MM-dd and MM-dd-yyyy
Integer is1stNumYear = yearCheck(Integer.parseInt(dateAry[0]));
Integer is3rdNumYear = yearCheck(Integer.parseInt(dateAry[2]));
Integer is1stNumMonth = monthCheck(Integer.parseInt(dateAry[0]));
Integer is2rdNumMonth = monthCheck(Integer.parseInt(dateAry[1]));
Integer is2rdNumDay = dayCheck(Integer.parseInt(dateAry[1]));
Integer is3rdNumDay = dayCheck(Integer.parseInt(dateAry[2]));
if (is1stNumMonth != -1 && is3rdNumYear != -1 && is2rdNumDay != -1) {
if (!dateCheck(is3rdNumYear,is1stNumMonth,is2rdNumDay)) {
return badDate;
}
newStr = is3rdNumYear + "-" + is1stNumMonth + "-" + is2rdNumDay;
} else if (is1stNumYear != -1 && is2rdNumMonth != -1 && is3rdNumDay != -1) {
if (!dateCheck(is1stNumYear,is2rdNumMonth,is3rdNumDay)) {
return badDate;
}
newStr = is1stNumYear + "-" + is2rdNumMonth + "-" + is3rdNumDay;
} else {
return badDate;
}
}
} catch(NumberFormatException e2) {
//e.printStackTrace();
return badDate;
} catch (Exception e) {
//e.printStackTrace();
return badDate;
}
} else {
return badDate;
}
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And this is the check functions i found

public static Integer yearCheck (Integer year) {
if (year > 1753 && year < 9999) { <br /> } else if (year >= 0 && year <= 20) { <br /> year = 2000 + year; <br /> } else if (year > 20 && year <= 100 ) { <br /> year = 1900 + year; <br /> } else { <br /> return -1; <br /> } <br /> return year; <br /> } <br /> <br /> public static Integer monthCheck (Integer month) { <br /> if (month > 0 && month < 13) { <br /> } else { <br /> return -1; <br /> } <br /> return month; <br /> } <br /> public static Integer dayCheck (Integer day) { <br /> if (day > 0 && day < 32) {
} else {
return -1;
}
return day;
}
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry for too many post.

I think i figured out which piece of code is exactly doing this. Below one

} else if (year > 20 && year <= 100 ) {
year = 1900 + year;

As in my case input string is '10-Mar-21'

So year is greater than 20 and also less than 100 so its making year as 1921

Now i have no idea how can i fix this. I can make the below 1900 as 2000 but i have no idea what other area might impact this
 
Paul Clapham
Marshal
Posts: 26520
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OMG! They wrote their own date-parsing code! (Complete with misspelled month names and misleading comments, of course. Straight out of the Daily WTF.)

I don't know what's supposed to happen when the two-digit year number can be a day number. Maybe the code takes care of that in some way. But for your question, I'd suggest looking at the yearCheck() method to see whether it happens to change two-digit years to four-digit values, for a start.

The real error was allowing people to enter dates in random formats, but I'm sure it's too late to fix that.
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:OMG! They wrote their own date-parsing code! (Complete with misspelled month names and misleading comments, of course. Straight out of the Daily WTF.)

I don't know what's supposed to happen when the two-digit year number can be a day number. Maybe the code takes care of that in some way. But for your question, I'd suggest looking at the yearCheck() method to see whether it happens to change two-digit years to four-digit values, for a start.

The real error was allowing people to enter dates in random formats, but I'm sure it's too late to fix that.



Seeing that myself a total newbie that someone did write something they felt right at that moment. Yes you are right it dies change two-digit to four digit. Below is the piece of code.

public static Integer yearCheck (Integer year) {
if (year > 1753 && year < 9999) { <br /> } else if (year >= 0 && year <= 20) { <br /> year = 2000 + year; <br /> } else if (year > 20 && year <= 100 ) {
year = 1900 + year; // THis is whats hurting me now. I dont know why this condition was put and why 1900. If i change this to year = 2000 + Year it wouldnt make a difference isnt it and simply it will change 21 to 2021 instead of 1921?
} else {
return -1;
}
return year;
}
 
Paul Clapham
Marshal
Posts: 26520
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good work. While I've been typing, you've been working. And yes:



That code converts two-digit years to four-digit values using a 100-year window from 1921 to 2020, and of course that broke in 2021. But it's hard to know how you should fix it, because it depends on what range of dates you expect to deal with. For example if your dates are invoice dates, then they aren't going to be very old and they could be in the future. But if they are people's dates of birth then they could easily be in 1922, if the person is about to reach 100 years old. So that's what you need to find out for a start.
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:Good work. While I've been typing, you've been working. And yes:



That code converts two-digit years to four-digit values using a 100-year window from 1921 to 2020, and of course that broke in 2021. But it's hard to know how you should fix it, because it depends on what range of dates you expect to deal with. For example if your dates are invoice dates, then they aren't going to be very old and they could be in the future. But if they are people's dates of birth then they could easily be in 1922, if the person is about to reach 100 years old. So that's what you need to find out for a start.



thank you Paul. this means a lot.

This is dynamic. Like the input date can be anything like invoice date, property purchase date, or some maintenance scheduled or maintenance completed date etc.
You are right as we dont know as there are so many dates in application and which range it falls in. I now have to figure out how best can i tackle this. thank you Paul for all help and guiding me
 
Saloon Keeper
Posts: 12876
279
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seeing as the code is broken now anway, can't you refactor it so that it only accepts 4 digit years, or even better, LocalDate? Throw an exception if the input doesn't contain a 4 digit year.

You should also replace all database entries with full length years, and put constraints on the column so that the database rejects dates in any other format.
 
Saloon Keeper
Posts: 23514
161
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I THINK that the Java date formatter supports 2-digit/4-digit year input conversion, but I'd have to go back and RTFM.

Standard practice for century conversion on 2-digit years would be to add 1900 to the year if the year was greater than 21 and to add 2000 to the year otherwise. If the data set is old, you might want to alter the cutoff year. And if you do manage to get decent 2-digit year parsing from DateFormat, make sure it doesn't "help" you in unexpected ways!
 
Paul Clapham
Marshal
Posts: 26520
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Actually, I THINK that the Java date formatter supports 2-digit/4-digit year input conversion, but I'd have to go back and RTFM.



I did actually RTFM earlier in the thread, and yeah, both the Java 1 and Java 8 date formatters/parsers do support that conversion. But you have to R the FM pretty hard to find it.
 
Paul Clapham
Marshal
Posts: 26520
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


A couple of comments about this code: I notice that the magic number 20 (meaning that 2020 is the last year of the 100-year window) is present twice in the code, which is a maintenance hazard. And it permits the year to be 100 (which it converts to 2000) but no other three-digit years. Also it permits four-digit years up to 9998 but not 9999, although hopefully the code will no longer be in use by the time that matters.

There's several other indications that the code was written by inexperienced programmers: for example it uses Integer instead of int for the parameter and return types, and the sequence of the if-clauses make it hard to understand what's permitted and what's converted to four digits and what's not permitted. And the name of the method suggests that a check is being done, which should result in a boolean value being returned, but instead it returns a potentially different year value.

Here's my rewrite, which is hopefully not as bad:

 
Rancher
Posts: 960
23
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Manju,
your problem is not a new one, but rather and old one: by convention is was decided that dates that come in a 2 digit format would be converted to 1900 if they could be doubles--1920 and 2020--the 1920 would be taken instead.  To fix your problem you have a options... add 100's years to the appropriate ones, change the text date to 4 digit year, or if your database supports it there may a switch to say default to 20xx format.  Yours is being converted in Java for your first 2 are the more viable options.
Les
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Seeing as the code is broken now anway, can't you refactor it so that it only accepts 4 digit years, or even better, LocalDate? Throw an exception if the input doesn't contain a 4 digit year.

You should also replace all database entries with full length years, and put constraints on the column so that the database rejects dates in any other format.



Hi Stephan,
this is what exactly i suggested to team, however there arent any more UI guys who could do this work for us and I will have to check with Database team if they can afford some effort.

I have got time now but i have do learn all basic of Java again and start working on this project in depth to understand flow and possibly change or enhance it. This almost stable version is only thing we have to process our ETL and in any case if i screw up without knowledge of fixing it if any issues arise i will be screwed all. But this forum really helped me in getting understand issue and at least fix or rather say work around for now.
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:

A couple of comments about this code: I notice that the magic number 20 (meaning that 2020 is the last year of the 100-year window) is present twice in the code, which is a maintenance hazard. And it permits the year to be 100 (which it converts to 2000) but no other three-digit years. Also it permits four-digit years up to 9998 but not 9999, although hopefully the code will no longer be in use by the time that matters.

There's several other indications that the code was written by inexperienced programmers: for example it uses Integer instead of int for the parameter and return types, and the sequence of the if-clauses make it hard to understand what's permitted and what's converted to four digits and what's not permitted. And the name of the method suggests that a check is being done, which should result in a boolean value being returned, but instead it returns a potentially different year value.

Here's my rewrite, which is hopefully not as bad:



Hi Paul,

that really looks neat, but please correct me if i wrong even this piece of code does same right? like if year they input 21 which falls under catefory year < 100 the output would again be 1921?
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Les Morgan wrote:Manju,
your problem is not a new one, but rather and old one: by convention is was decided that dates that come in a 2 digit format would be converted to 1900 if they could be doubles--1920 and 2020--the 1920 would be taken instead.  To fix your problem you have a options... add 100's years to the appropriate ones, change the text date to 4 digit year, or if your database supports it there may a switch to say default to 20xx format.  Yours is being converted in Java for your first 2 are the more viable options.
Les



Hi Les,

thank you, please dont get me wrong, i am a DBA and have little amount of Development experience. I was just dragged into this. I am very happy working on something i loved years back but i definately need sometime to get back haha.
Can you please help understand a bit more like how can i achieve this solution

"add 100's years to the appropriate ones"
 
Paul Clapham
Marshal
Posts: 26520
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Manju Bhat wrote:that really looks neat, but please correct me if i wrong even this piece of code does same right? like if year they input 21 which falls under catefory year < 100 the output would again be 1921?



Yes, it's just an example of the sort of thing that a programmer who has been brought in to fix this problem should be doing.

However my impression is that the company just wants this one single problem fixed and since it looks like a small thing, they imagine that a small fix should be sufficient. If you want to go along with that idea, which is wrong, then just change the two "20" to "21" and you're probably good for another year. But then I strongly advise you not to get involved any farther than that. Anything more, it should be done by a competent Java programmer, which I think you'll agree isn't you right now.

But you said you're a DBA. And the problem is that the database allows people to put in dates with two-digit years. So it seems to me (and Stephan earlier) that fixing the database to prevent that would be a better approach. And you're a DBA...
 
Tim Holloway
Saloon Keeper
Posts: 23514
161
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote: the company just wants this one single problem fixed and since it looks like a small thing, they imagine that a small fix should be sufficient.



"All You Have To Do Is..."  

Th deadliest words in IT.
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:

Manju Bhat wrote:that really looks neat, but please correct me if i wrong even this piece of code does same right? like if year they input 21 which falls under catefory year < 100 the output would again be 1921?



Yes, it's just an example of the sort of thing that a programmer who has been brought in to fix this problem should be doing.

However my impression is that the company just wants this one single problem fixed and since it looks like a small thing, they imagine that a small fix should be sufficient. If you want to go along with that idea, which is wrong, then just change the two "20" to "21" and you're probably good for another year. But then I strongly advise you not to get involved any farther than that. Anything more, it should be done by a competent Java programmer, which I think you'll agree isn't you right now.

But you said you're a DBA. And the problem is that the database allows people to put in dates with two-digit years. So it seems to me (and Stephan earlier) that fixing the database to prevent that would be a better approach. And you're a DBA...



Thanks Paul. Got it. Yes I had discussion today and for now they just want this thing to be fixed, so like you said I am just setting it to 25 instead of 20 for now and be done. I totally agree that I am no where near to a competent Java Developer. This project maintenance has come upon me. So going forward I will have to maintain it and have told me take your time and suggest any improvisation. Understanding the logic behind is not a problem as I know what the flow of the ETL should be. I just need to learn all the terminologies used and start with basics. This is no where in line with my long term goal but just have to take it as additional responsibility.

I had a question, I saw something in eclipse as generate Javadoc, is this documentation or will it generate the flow of project? or is there any tool which will generate a flow chart or something from existing code?
 
Tim Holloway
Saloon Keeper
Posts: 23514
161
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Javadoc is a utility program that comes bundled as part of the JDK. It is what Sun/Oracle and most major third-party developers use to develop API documentation.

JavaDoc works by scanning the project source code tree looking for special annotations in the code (as well as user-contributed documentation files). If you've ever seen my sample source code here on the Ranch, I usually have JavaDoc comments in it just to illustrate best practices.

JavaDoc also parses the Java code itself so even if you don't supply any annotations it will at least outline the classes and methods and properties (subject to options settings when running JavaDoc).

The common JavaDoc run produces a directory tree of HTML pages suitable for publishing as online documentation as a web site and that's exactly what Oracle does. There are also ways to produce alternative formats such as PDFs. I don;t doubt that if I wanted to, I could also create epub-format books for my Nook reader if I wanted, although that would probably require some of my external tools (of which I have many, since I'm into computer typesetting and publishing!)

It can't flowchart, but then again, flowcharts are rarely used in OOP apps, since the long spaghetti coding techniques of older languages are not good form and you should generally be able to deduce logic flow from a glance in Java. Method usage paths are a good thing to have, though JavaDoc doesn't directly plot them. Adding "@see" tags to your source can help there, however, since it can create hyperlinks to elements of interest including properties and methods.

If you want to plot your own flowcharts or similar diagrams, I can recommend the graphviz open-source utility. It can take a set of statements and produce charts in JPG, PNG, SVG (recommended) and other graphics file formats and JavaDocs can then reference these files, since you can embed HTML in your JavaDoc comment annotations. That's also good when you'd like tables and lists in your generated documentation. As well as boldfacing, italics and so forth.

You could, in fact, create an entire book using JavaDocs, although most users (including Oracle) don't come near that much ambition.

The JavaDoc menu in Eclipse provides a handy way of configuring and running JavaDoc without leaving the IDE to do so. Incidentally, the IntelliJ IDE also has a JavaDoc menu. Not sure about NetBeans, but very likely since Sun used to own it.
 
Manju Bhat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank You Tim
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic