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 136416 - completion: lists boolean options for integer only parameters
Summary: completion: lists boolean options for integer only parameters
Status: VERIFIED INVALID
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords:
Depends on:
Blocks: 146952 154422
  Show dependency tree
 
Reported: 2008-06-03 19:55 UTC by Lark Fitzgerald
Modified: 2009-09-04 12:51 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 Lark Fitzgerald 2008-06-03 19:55:31 UTC
Product Version: NetBeans IDE 6.1 (Build 200804211638)
Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
fx NB61 cb plugin: 243

1. create Linear Gradient sample
2. open and go to any of the var C# = Color.rgb (...) lines like:
var C6 = Color.rgb(  25, 255, 200 );
3. position cursor after ( and press ctrl+space:
4. the following list shows
bind
false
new
null
true

true and false should not be in this list since they are not valid.
Comment 1 David Strupl 2008-07-15 09:31:17 UTC
This should be fixed for 1.0.
Comment 2 Lark Fitzgerald 2008-10-13 21:06:48 UTC
True and false are still on the list:

Tested using FX Cont trunk build 349 with SDK:
Product: javafx-1.0dev, Platform: windows-i586, Build-Number: 708, Build-ID: 2008-10-13_03-09-52 on NB6.5: 
Product Version: NetBeans IDE Dev (Build 200810060201)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b14
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 3 David Strupl 2008-10-28 14:37:47 UTC
Not now.
Comment 4 Martin Krauskopf 2009-09-03 13:43:04 UTC
The completion's behaviour is valid. Since true and false are not listed among "smart items.

Try e.g. this:

  var f = false;
  var i = 1;
  var c = Color.rgb(|50, 100, 150); // | - means cursor

'i' is listed as a smart item, since it fits the type.
The rest are listed as well since user might call methods on those objects which returns integer. E.g. (yup, a bit
artificial in this case, but semantically valid):

  var someB = computeMyBoolean();
  var aBitOddC = Color.rgb(true.compareTo(someB) * 100, 100, 150); // | - means cursor
Comment 5 Martin Krauskopf 2009-09-03 14:23:34 UTC
Added test specification: #4aa4b8225281
Comment 6 Alexandr Scherbatiy 2009-09-04 12:07:12 UTC
Sorry, I do not understand.

For example:
-------------------------------------------------------
import javafx.scene.paint.Color;

var c = Color.rgb( | 50, 100, 150); // | - means cursor
-------------------------------------------------------

- Press <Ctrl+Space>
- Select false
-------------------------------------------------------
var c = Color.rgb( false, 100, 150); // | - means cursor
-------------------------------------------------------

There is the compile error:

Main.fx:11: cannot find symbol
symbol  : function rgb(boolean,int,int)
location: class javafx.scene.paint.Color
var c = Color.rgb( false, 100, 150); // | - means cursor
1 error


May be the true and false should be listed among smart items?

Comment 7 Martin Krauskopf 2009-09-04 12:17:59 UTC
On the cursor position (in previous comments' samples) you want to type some int value. You might type e.g.:

  50
  anIntVaribale
  someObj.someMethodReturningInt()
  someObj.someMethodReturningInt(param1, param2)
 
thus code-completion in NetBeans offers you as smart items (the first listed above the separator, if any available)
objects which fit type directly ("i" variable in my sample bellow).

But it also offers you other objects available in the scope, like "someObj" above, since you might want to type that
object and call method returning int (in this case). false and true are such objects. HTH.
Comment 8 Alexandr Scherbatiy 2009-09-04 12:51:26 UTC
I see now.

Do not think that is very useful to invoke methods from true and false.
It is rather Java than JavaFX feature.