Community
Participate
Working Groups
Im not sure this is a bug, but Im getting a strange behaviour of one of the task entries. I had a nasty method that I got the following message about "Nested Block Depth 6.0 is not in safe range [0 - 5.0]; use Extract-method to split the method up". This I did, and it still reports the method of being not in the safe range. Code is added to this bugreport below. I can delete the whole method body in the offending method and still get the same error, what is wrong? Ive shutdown eclipse, hoping to refresh the task cache; Ive recompiled the whole project hoping this will fix it. but no result, it still says that an empty method has a too high "nested block depth". Is this correct? Is there anything else in the class that is bad? Code after doing the "extract method", the method RemoveMessage() was extracted to a new method, but it still reports the acknowledgeMessages() method as having a large Nested block depth. ============================================================ /** * Finds the message in the Post office library. * @param id the messages id. * @return the Message if it was found; null otherwise. */ private Message findMessage( int id ) { Message foundMessage = null; Collection messageList = PostOffice.getInstance().getLibrary ().getStoredMessages(); for ( Iterator messages = messageList.iterator(); messages.hasNext() && (foundMessage == null ); ) { Message message = (Message) messages.next(); if ( message.hashCode() == id ) { foundMessage = message; } } if ( foundMessage != null ) { log.finest("Could not find the message id, " + id ); } return foundMessage; } /** * Acknowledge the messages specified in the parameters list. * @param parameters all messages that are to be acknowledge (removed). */ private void acknowledgeMessages( Map parameters ) { for ( Iterator parameterKeys = parameters.keySet().iterator(); parameterKeys.hasNext(); ) { String key = ((String) parameterKeys.next()).toLowerCase(); String value = (String) parameters.get( key ); if ( key.startsWith( FORM_MESSAGE_ID_STR ) && ( value != null ) && ( value.equalsIgnoreCase("on") ) ) { removeMessage(key.substring( FORM_MESSAGE_ID_STR.length() )); } } }
The offending message isn't generated by the Java compiler, thus recompiling have no effect on it. Which tool did produce this message ?
Dirk - would this message ring a bell to you ?
JDT/UI doesn't generate this message either. Erik, do you have some inspection/code metric plug-ins install (like the one from instantiations) ?
You are so right, this was a stupid bugreport from my side. This was a bug (or feature) in the metrics plugin that ive downloaded. (im pretty sure I disabled it through their perference panel). BTW, it would be nice be able to see which plugin that generated a certain task, for these occasions when the user are unsure on who is responsible. Anyhow, sorry that I posted this invalid bug.
I thought the same about documenting tasks, and entered bug 38136. Closing as invalid.
this one is caused by my plugin. Please enter a bugreport at http://www.sourceforge.net/projects/metrics Frank