When you use Eclipse by default most generic type problems show up as warnings. Unfortunately this results in lots of warnings when you use ATG code.
You can turn off the warnings that result from ATG code by checking the option “Ignore unavoidable generic type problems”.
Ignore unavoidable generic type problems
For example you might have code like this where getValues() comes from the ATG API:
By default Eclipse reports warnings for the above line. But this is unavoidable and with this Ignore option turned on no warning is reported for this line.
Kind of useful and you don’t have to add @SuppressWarnings(“unchecked”) liberally through your ATG code.
When I imported a new project I could not build it because of “Resource already exists on disk” errors like this.
The simple fix was to remove the directory, typically classes, which contained the file it was complaining about and then refreshing. Removing just the file and then refreshing did not work.
However when I would do an ant build later and then refresh my project I would get the same error.
The better solution is to tell Eclipse not to copy the files it is complaining about to the output folder.
- Go to Project Properties.
- Select Java Compiler -> Building.
- In the Filtered resources box add the files you don’t want copied.
- Rebuild project.
Here is a screenshot showing how I added “*.properties, *.xslt” to the Filtered resources to fix this problem.
Eclipse: Filtered resources in Project Properties, Java Compiler, Building
Tips de SVN by dbasulto
I am always forgetting how to undelete. I wish subversion made it easier but the only way to do it is to do an svn copy of the last version. For example:
svn cp url/to/removed/foo.txt@4 .
You can find the URL by looking in .svn/entries.
For more info please see What’s a simple way to undelete a file in subversion?
IBM Rational Application Developer (RAD) is basically a typically IBM heavy version of Eclipse. WebSphere is a typically IBM heavy version of a J2EE server. Therefore you would think you could debug web applications using RAD fairly easily like you can on JBoss or ATG DAS using Eclipse.
However I could not find anyone on my latest project who knew how to do this. Fortunately after much Googling I found this PDF document, Debugging Applications in IBM Rational Application Developer, and on page 12 are instructions on how to do this.
The instructions seem to be a little out of date so here are my instructions.
- Log into your Integrated Solutions Console. The default URL is http://localhost:9060/ibm/console/login.do.
- Navigate using the left side column to Servers –> Application Servers.
- Select the Application server you want to debug from the list of Application servers.
- Under the Configuration tab select the Debugging Service link which is near the bottom right in the Additional Properties section.
- Select the “Enable service at server startup” checkbox. Note the JVM debug port.
- Press the Apply button.
- In the Messages box, which appeared at the top after pressing the Apply button, click on the Save link.
- Stop and start your Application Server. It should now be running in Debug mode.
- In RAD go to the project for the web application you want to debug.
- From the menu select Run –> Debug Configurations.
- Select Remote Java Application and press the New button (it’s the top left button). For the port set it to the JVM debug port (default is 7777).
- Press Apply. Then press Debug. It should connect to WebSphere’s JVM.
Now you can set breakpoints and even change small amounts of code which will be deployed automatically to WebSphere. No more waiting 15 minutes to test every change you make because builds are so brutally long.
snubbed by Rennett Stowe
In the course of a project there are always files and directories that you don’t want to check in but which Subversion complains it doesn’t know anything about them. So it makes sense to tell Subversion to ignore them, in other words, keep quiet.
The mechanism for doing this works okay but I wouldn’t say it’s perfect.
This is how I do it.
- Go to the directory where want to ignore a file or subdirectory.
- Issue the command
svn propedit svn:ignore .
- Your editor then will be launched and you can enter one line at a time those files and/or subdirectories you want to ignore.
- Commit your changes.
svn commit -–depth empty
Two things to notice.
--depth empty argument
only commit the propedit changes
- Committing your changes means everyone will end up ignoring these files and/or directories so make sure you are ignoring the right ones.
- If you don’t want to commit your changes you can revert them.
svn revert .
For further reading please see Pete Freitag’s blog post Ignore Files and Directories in Subversion.
Eclipse user libraries are wonderfully convenient ways of packaging together related JAR files. In my Eclipse I create user libraries for each ATG version I install. As a consultant I am always installing different versions and today I installed ATG 9.0.
Normally I use the GUI to create the user library for the latest ATG server. However I thought this is quite inefficient because I already have user libraries for previous versions of the ATG server. I just need to duplicate one of the other ATG user libraries and then tweak the duplicate to have the right path to the JAR files.
Unfortunately the Eclipse GUI does not provide a way to duplicate a library. So I searched in my workspace files and found in my .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs file the settings for all my user libraries.
I then edited that file and copied an entry for an older ATG library, org.eclipse.jdt.core.userLibrary.ATG\ 2007.1. I renamed it org.eclipse.jdt.core.userLibrary.ATG\ 9.0 and updated the paths to where ATG 9.0 is installed and I was done!
You can have Perforce alert you about changes to sections of the depot.
To do this using the Perforce GUI.
- Go to User -> Edit <your name>…
- Add the branches in the Reviews section that you want to monitor. For example:
Thanks to fellow developer Bill Crook for the tip.
Update: Michael Delaney, Perforce guru, pointed out that this works only if a P4Review daemon is running which it is not by default.
In the September/October 2008 Technology Review I read a short article on Seth Hallem, one of the TR35. The subtitle of this article was “Deconstructing software to find bugs.”
As a graduate student at Stanford, Seth Hallem perfected an improved approach to finding bugs, called static analysis… Hallem developed algoritems to … examine only the most important combinations, allowing millions of lines of code to be examined quickly and efficiently. He cofounded Coverity in San Francisco.
This article, Adding a Directory Tree, shows how to add a directory tree to your perforce repository.
- On UNIX, run:
find . -type f -print | p4 -x - add
find command will find files, but will not find symlinks. Nevertheless, you can add symlinks to Perforce using a similar method. Be aware, however, that symlinks are read-only entites, and that editing a symlink is not the same as editing the file it references.
To discover the symlinks that exist in your client workspace and assess whether or not you want to version them, run the following command from your client workspace root:
find . -type l -print
(That's an "el" as in "l" for link)
To add symlinks, run:
find . -type l -print | p4 -x - add -t symlink
- On Windows, using the MS-DOS command shell, run:
dir /b /s /a-d | p4 -x - add
Perforce branching is pretty simple.
Say you want to create a branch called
First you would add it to your client.
Next you would do an integration from where you wanted to cut the branch.
p4 integrate //depot/work/foo/... //depot/fkim/foo/...
Then you would submit the integration and the branch will be created and updated in your client work space.