This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 243854 - Hint "The assigned value is never used" is sometimes incorrectly applied
Summary: Hint "The assigned value is never used" is sometimes incorrectly applied
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-15 23:11 UTC by swpalmer
Modified: 2016-07-07 07:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description swpalmer 2014-04-15 23:11:31 UTC
Product Version = NetBeans IDE 8.0 (Build 201403101706)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.0-b70

With the following code block, each 'case' line was highlighted incorrectly with "The assigned value is never used"

	static protected Object convertPropertyValueForValueType( PropertyValueType vt, Object val ) {
		Object result = val;
		if( val != null && vt != null && vt.getType() != null ) {
			switch( vt.getType() ) {
				case BOOLEAN:	result = Utils.getAsBoolean(val); break;
				case STRING: 	result = Utils.getAsString(val); break;
				case TEXT: 		result = Utils.getAsString(val); break;
				case INTEGER:	result = Utils.getAsLong(val); break;
				case NUMBER:	result = Utils.getAsDouble(val); break;
				case FILE:		result = Utils.getAsFile(val); break;
				case DIRECTORY:	result = Utils.getAsFile(val); break;
				case RATIONAL:	result = Utils.getAsRationalNumber(val); break;
				case TIME:		result = Utils.getAsTime(val); break;
				case COLOR:	result = Utils.getAsColor(val); break;
				//case TIMECODE:	result = Utils.getAsTimecode(val); break;
				default: throw new IllegalArgumentException( "Conversion not implemented: "+vt.getType() );
			}
		}
		return result;
	}
Comment 1 Jiri Prox 2014-04-16 07:23:03 UTC
reproducible



Product Version: NetBeans IDE Dev (Build 201404140001)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b70
Runtime: Java(TM) SE Runtime Environment 1.8.0-b132
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev
Comment 2 Martin Balin 2016-07-07 07:18:26 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss