Originally posted by Norm Radder:
Getting more software is not a workable solution. I'd like to keep it as simple as possible.
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Norm Radder:
The value of the clock is not important. Uniqueness is the issue. I assume that the value of the clock will be different every time I compile a program.
Originally posted by Pat Farrell:
The $Revision$ hack works at compile time. If you want it at run time, you can store a value in a file on the disk, and read the file at program startup.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
If you really need it to be unique, you can't rely on a clock time. You may have a really fast computer that doesn't resolve to unique times.
compile it after getting the file with the revision filled in.
Originally posted by Norm Radder:
Getting the revision filled in is what I was looking to have happen automatically by using the annnotation runtime feature.
If I take care to fill in the revision, I might as well change the source when I am editting it and this whole problem goes away.
Originally posted by Norm Radder:
The problem is, I forget/am lazy and wanted an automatic way to put a unique value into a class file so that when talking to a client with a problem I know which class file he has and would be able to get the same one on my system to test with. The way I'd know I had the same class file was because of the unique ID that was in the file.
Steve
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Norm Radder:
Not sure what this means. If I get the clock time and store it in a class file when the class file is compiled. Won't the value stored ALWAYS be different from the value stored in a class file the next time I compile it? There is no way I could compile the program, copy the resulting class file somewhere and compile the program again with the clock times for the two compiles to be the same
Originally posted by Norm Radder:
The problem is, I forget/am lazy and wanted an automatic way to put a unique value into a class file so that when talking to a client with a problem I know which class file he has and would be able to get the same one on my system to test with. The way I'd know I had the same class file was because of the unique ID that was in the file.
Originally posted by Norm Radder:
I'm a one man shop and my clients are friends that use what I write. A CVS is a bit too much for my needs.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
You are making a gross assumption about the length of time required to do your bunch of stuff. This may work, but it is essentially setting up a race condition.
You could use a file-comparison utility to see if they are byte-for-byte equivalent. However that will tell you that two classes are the same if all the bytes are the same, whereas they might have been created three weeks apart from source code which had not changed. It's not clear how your requirements apply to that situation.Originally posted by Norm Radder:
Given two copies of class file for the same java class, how can I easily test to see if they are copies. Ie were generated in a specific, single compile.
Originally posted by Norm Radder:
Given two copies of class file for the same java class, how can I easily test to see if they are copies. Ie were generated in a specific, single compile.
why you would care if it was compiled at a specific time
Originally posted by Norm Radder:
Sorry, I'm unable to communicate what I'm looking for.
I don't care when it was compiled. I want an easy way to determine if a file on my computer is the same as a version of the file on another computer. The Last Mod date seems the easiest.
A client calls up and says a verion of my code is not working. I ask what version and ask him to look at the last mod date. When I get that I will be able to find in my archive the same code on my system to be able to test for his problem.
able to look at the .class file
Originally posted by Norm Radder:
Very easily done with Winzip or XP (by renaming .jar to .jar.zip) with the class file in a jar file.
Originally posted by Norm Radder:
WAY WAY WAY TOO MUCH other software.
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|