Error in referencing function using package - netbeans

NetBeans 8.2 Patch 2 (Build 201705191307)
My package hierarchy is:
spider;
spider.ui;
spider.ui.output;
My classes w/functions are:
spider.ui.DisplayManager.stateMachine
spider.ui.output.DisplayManager.stateMachine
The duplication of class names and function names is deliberate. All stateMachine functions are static, that is,
public static stateMachine() { }
I attempt to reference the spider.ui.output.DisplayManager.stateMachine in the spider.ui.DisplayManager.stateMachine using:
import spider.ui.output.DisplayManager;
stateMachine() {
spider.ui.output.DisplayManager.stateMachine()
}
and get a "ui" variable not found.
Cannot find symbol
symbol: variable ui
location: variable spider of type JFrame
I would have expected that if there was an error it would be in using duplicate names not in identifying the "ui" in spider.ui.output.DisplayManager.stateMachine() as being wrong.
It is not a great labor to change the names so that they are unique, but can anyone tell me why I get the error message I do?

I apologize and thank you all. This was most definitely an Operator ERROR, that is, it was created by me.
What was pointed out to me was that:
Spider spider; //variable and
o o o
spider.ui.*; // collide
Once "Spider spider;" was removed, the error was cleared.
What mystified me was that the error message said that 'ui' in "spider.ui." was at fault because "ui" was a variable which could not be found. If I had given it an even moment of thought I would have guessed that the compiler was treating "spider" as an variable name and not a package name. But mystified or not, the error went pfft once "Spider spider;" was removed.
Thanks again and I am sorry to have wasted your time.
The good news is that I earned some StackOverflow brouwnie points for giving a faulty analysis about an error. So I am just wonderful.
art

Related

Unity Can't Find C# Script

I can't seem to compile on Unity because all of my scripts have errors. The error messages keep on repeating, "The associated script cannot be loaded. Please fix any compile errors and assign a valid script." I have checked all of my scripts on Visual Studio 2017 and have not found any errors.
The image below shows the error showing on the inspector view of the unity engine:
If there are really no compiler errors as you say the reason might be incorrect file names or class types.
Make sure that the file names and the class names match!
If your class is called
public class Player_Collision1 : MonoBehaviour
{
...
}
the script/file must exactly be called
Player_Collision1.cs
and the other way round.
Attention: The Unity project view (Assets) strips of the file endings so there it should only display as
Player_Collision1
Another reason for a script to be not valid is e.g. if your class doesn't inherit from MonoBehaviour at all.
Unity would usually prevent you from adding those "invalid" scripts to an object but it might happen that you renamed them or changed their type afterwards. In this case you will see the error you currently have.
Check you log and see if any compiler error has happened.If no have a look at your class name and file name are same.
I see that you are (relatively) new here. welcome to Stack Overflow! ^^
what unity is trying to say is that it can't compile your scripts because there is one or more another script(s) that have errors in them.
in the Console, you will find your errors and by double left clicking on one of then, you will be taken to the script and the location of its error.
by selecting (left click) an error you will be able to read more a more detailed description of the error.

Overture error: Name 'BinBuilder()' is not in scope

I've been doing the exercises of a book focused on iteratively building a whole application. After having written four classes, I'm writing my fifth which is a test for the fourth one. However, Overture is reporting a "Name 'BinBuilder()' is not in scope" error; BinBuilder is the last class I successfully wrote. I cannot figure out what I'm doing differently this time. BinBuilder is not the only class causing problems, two other are too. Since I don't know what's wrong, I'm including a link to the whole thing here. Thank you.
EDIT: It links a zip file exported from Overture and it includes a screen capture showing the error.
You have the following:
builder: BinBuilder := BinBuilder();
But I think you mean:
builder: BinBuilder := new BinBuilder();
The "not in scope" error means "I can't find a function or operation call of that name in scope". It's not a great error message, I'm afraid. Overture and VDMJ use the same "not in scope" message for when a name does not exist anywhere and for when it does exist, but is not visible within the current scope. In this case, the syntax causes it to look for a func/op call rather than a class name.

How to get rid of strange doxygen warning

When running doxygen over one particular pretty large C-language project consisting many files (all completely documented, I think), then I always find this warning at the bottom of the output:
<#1>:1: warning: parameters of member #1 are not (all) documented
How can I find and remove the trigger of this warning?
Note that the project in question is too large (and the issue not important enough) for bisection or other trial and error based search methods.
Realize this is an old question but just ran into this behaviour myself and didn't find a solution online.
Found the offending file by running Doxygen and looking at where the error message appears in the output (make sure you're not suppressing stdout or you'll just get the error with no context).
In my case the error appeared after the line "Generating dependency graph for group [name]". By looking at the relevant file I found an undocumented, unnamed enum. The members of the enum were still documented. e.g.
enum
{
X = 1, /**< Documented. */
...
}
I'm guessing it's the lack of name on the enum that was throwing Doxygen and causing the unhelpful message. Adding a name causes more helpful error messages to be generated. Documenting the enum (with or without a name) removes the error.

conflicting distributed object modifiers on return type in implementation of 'release' in Singleton class

I have recently upgraded to Xcode 4.2 and its started to give me so many semantic warnings with my code...
one of them is "conflicting distributed object modifiers on return type in implementation of 'release'" in my singleton class..
I read somewhere about - (oneway void)release; to release this warning but once i put that in my code i start to getting compile error as "Duplicate declaration of release" not sure why and if you try to find the second declaration it shows in this line
SYNTHESIZE_SINGLETON_FOR_CLASS(GlobalClass);
Update: This is the post where it explained about - (oneway void)release;
how to get rid of this warning "conflicting distributed object modifiers on return type in implementation of release" ? and why its happening ?
The post you link to contains the solution to the problem in the title and explains why it happened to you.
However, from reading your question it appears that your new issue is caused by mis-applying the great advice in that post's answer. I am fairly certain you added the line
- (oneway void) release {}
in your .m file rather than amending your existing
- (void) release {
line with the extra word "oneway".
This would be why you get "Duplicate declaration of release". Yes, this is confusing because it's a duplicate definition that is invisibly creating the duplicate declaration. But I've just tried doing it your wrong way, and I get that "duplicate declaration" message.
I get the impression, perhaps wrongly, that you didn't realise you actually had a release method, particularly when you think adding the line will "release this warning".
Don't take all errors too literally, and always try to think what someone might really mean as it's often different from what they say, but do try and understand what is in your code, even in the classes you've taken off the shelf.
And to address other questions raised, the reason you're overriding release is because it is a singleton which is not usually released. You probably only have a definition in your code, which will suffice.
What Jonathan Grynspan has to say about specifying on both the declaration and the definition is broadly valid (and indeed the root of the issue) but it's important to recognise that in this specific case, the declaration is by Apple's foundation code which has changed.
So, if it's not clear already, amend the line that XCode finds problem with to include the word oneway.

Silverlight 4, MEF, Export/Import errors, Mefx doesn't want to work

Out of frustration and more than 3 days googling up this issue... i have no choice but to bother you guys with my question.
i am creating a Silverlight application. I am using MEF. When i try to run my application i get the following error.
The invocation of the constructor on
type
'IFG.Silverlight.Client.Views.MenuView'
that matches the specified binding
constraints threw an exception. [Line:
25 Position: 47]
and its Inner exception is as follow...
The composition remains unchanged. The
changes were rejected because of the
following error(s): The composition
produced a single composition error.
The root cause is provided below.
Review the CompositionException.Errors
property for more detailed
information.
1) No valid exports were found that
match the constraint
'((exportDefinition.ContractName ==
"MenuViewModel") AndAlso
(exportDefinition.Metadata.ContainsKey("ExportTypeIdentity")
AndAlso
"IFG.Silverlight.Client.ViewModel.MenuViewModel".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))',
invalid exports may have been
rejected.
Resulting in: Cannot set import
'IFG.Silverlight.Client.Views.MenuView.ViewModel
(ContractName="MenuViewModel")' on
part
'IFG.Silverlight.Client.Views.MenuView'.
Element:
IFG.Silverlight.Client.Views.MenuView.ViewModel
(ContractName="MenuViewModel") -->
IFG.Silverlight.Client.Views.MenuView
Ok. my code is very simple since it's a test application.
i have an Interface IRetailModel
namespace IFG.Silverlight.Client.Common
{
public interface IRetailModel
{ ............
then i have a class that implements this interface
namespace IFG.Silverlight.Client.Model
{
[Export(typeof(IRetailModel))]
public class RetailModel : IRetailModel
{ .................
Then I have my ViewModel for the View
namespace IFG.Silverlight.Client.ViewModel
{
[PartCreationPolicy(CreationPolicy.NonShared)]
[Export(ViewModelTypes.MenuViewModel)]
public class MenuViewModel : IFGViewModelBase
{
IRetailModel _model;
[ImportingConstructor]
public MenuViewModel(IRetailModel model)
{
Well, i found that there is a magical tool called MefX that it's supposed to debug deep to the bone your code and tells you what's going on... I havent been able to get this to work.
I followed directions from this article http://blogs.msdn.com/b/nblumhardt/archive/2009/09/24/debug-composition-from-within-visual-studio.aspx
When i try to run it says
Error: Unable to load one or more of
the requested types. Retrieve the
LoaderExceptions property for more
information.
Then went back to Google and i found this Visual MefX (which is the same but with a GUI) and i can load the .xap but basically it gives me the same info that i get from Visual Studio. I can't find the darn [BECAUSE]...
I am really, HONESTLY AND DEEPLY, frustrated with this situation. Can anyone explain to me where am i failing to get MefX to do its job? I know the risk of dealing with these Overnight Frameworks (lack of documentation, buggy, etc etc) that MEF seems to be, but Prism is not a option to me (i feel like buying a M16 to kill a fly when i can use my finger).
Thank you
For future reference, an updated version of Visual Mefx is attached to this blog post: How to Debug and Diagnose MEF Failures. It is also part of MEFContrib, although I'm not sure if the MEFContrib version has all the changes from the version in the blog post.