Feature - Rejected Code cleanup - remove unused imports, types, methods, and fields; format code (patch)

This is all in preparation for migrating the KoLmafia code base from Java 1.4 to Java 5.

WARNING: large patch file (almost 11 MB, zipped to 1.75 MB)

I hope I did the patch correctly this time! ;)

EDIT: Should note that this patch is based on r10613.

EDIT 2: Patch removed, see follow-up post further down.
 
Last edited:

Veracity

Developer
Staff member
I looked at this, and the huge bulk of it is changing text formatting. For example, in ValhallaDecorator.java:

Code:
507,509c281,282
< 		if ( InventoryManager.hasItem( ItemPool.CITADEL_SATCHEL ) )
< 		{
< 			buffer.append( "<nobr><a href=\"guild.php?place=paco\">complete white citadel quest by turning in White Citadel Satisfaction Satchel</a></nobr><br>" );
---
> 		if (InventoryManager.hasItem(ItemPool.CITADEL_SATCHEL)) {
> 			buffer.append("<nobr><a href=\"guild.php?place=paco\">complete white citadel quest by turning in White Citadel Satisfaction Satchel</a></nobr><br>");

It "cuddled" the curly brace. Here's another one from that same file:

Code:
551,555c323,326
< 	private static final void developerGift( final StringBuffer buffer, final int itemId, final String developer )
< 	{
< 		int giftCount = InventoryManager.getAccessibleCount( itemId );
< 		if ( giftCount <= 0 )
< 		{
---
> 	private static final void developerGift(final StringBuffer buffer,
> 			final int itemId, final String developer) {
> 		int giftCount = InventoryManager.getAccessibleCount(itemId);
> 		if (giftCount <= 0) {
It split the parameters into two lines and removed spaces next to parenthesis.

I very very very much do NOT like that. I could argue that imposing uniform formatting on the codebase with an automated tool is a good idea, but the vast majority of the code is in the "correct" format, according to our coding standards, and changing it to a different format is not acceptable.

I should probably write and check in the Coding Standards file that I've been talking about since July 1 of last year (the date I created an empty file to be filled in later).
 
Good point! If I had known you had coding standards already, I wouldn't have formatted the code to begin with. Your input is very much appreciated.

EDIT: Whoops, I forgot to say that I need to redo the patch then... Ugh, that's going to take a lot of work, but will produce a far smaller .patch file.

EDIT 2: New patch. Much smaller now, since it contains only the warning fixes. Had to zip the .patch file due to file size limits.
 
Last edited:
Top