IT, computer and programming tutorials and tips that i couldnt find anywhere else using google, from my daily work as a Senior Developer of solutions using Java and Linux.

The best place to *find* answers to programming/development questions, imo, however it's the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but again, a great reference for *finding* answers.

i created a java class with a "main" method, some static variables and some normal (non-static) instance variables, then ran this file with debug breakpoints on all lines of code to find the processing order and here's what i found:

* access modifiers for variables and methods (private, public, protected, etc) don't seem to affect processing order, ALTHOUGH the "main" method must have the "public" modifier

* standard getter and setter methods for variables don't get processed, i.e. debugger never stops on their breakpoints

* "static final" variables don't get processed by the JVM during initialization or instantiation of the class, i.e. debugger never stops on their breakpoints

processing order:1. static variables and static initialization blocks, in textual order of appearance2. "main" method:2.1 begin executing any logic encountered2.1.1 if a call to instantiate the containing class is made (i.e. "new JVMClassInitializationProcessingOrderTest()"), temporarily pause execution of "main" method logic2.1.1.1 initialize (non-static) instance variables and (non-static) initialization blocks, in textual order of appearance2.1.1.2 process the class' constructor2.1.1.3 resume execution of the remaining logic in the "main" method

20131125

i've been recently reviewing some basic java principles lately and today i got to thinking about the word "class" and wondering exactly what that word is actually known as, e.g.:

public class MyClass { ...}

i found in the java tutorial an article called Java Language Keywords:
"Here is a list of keywords in the Java programming language. You cannot use any of the following as identifiers in your programs. The keywords const and goto are reserved, even though they are not currently used. true, false, and null might seem like keywords, but they are actually literals; you cannot use them as identifiers in your programs.
"

---
NOTE: the red line in the class AccessControlTest:PackagePrivate pPriv = new PackagePrivate();

will not work (and is not expected to work) because class PackagePrivate is declared with a package-private access modifier, i.e. no "public" in front of the "class" keyword identifier, so the class AccessControlTest shouldn't have access to the class PackagePrivate because of java's access control rules.
---

however, when i first tried importing/referencing the class PackagePublic in the class AccessControlTest, i got the following error in eclipse:The resource is not on the build path of a java project

but the "close" button, nor anything else in the p:dialog, was getting rendered in the browser.
finally, i figured out (thanks to my colleague dan) that p:panelGrid simply needed a defined "columns" attribute, like this:

20131113

i have my primefaces jar included in my project build path, and when i do ctrl+space in an xhtml/jsf file, inside a primefaces tag, i get the list of available attributes, but there's no description for them:

i found a workaround by accident: when the autocomplete window is open, as shown in the screenshot above, do ctrl+space again, several times, until you rotate back to the attributes list, and THEN the description will show:

20131107

when trying to view a jsf page, i got the following error in the browser: http 500 error:com.sun.faces.mgbean.ManagedBeanCreationException: Cant instantiate class: com.test.userUsersDataBean

and this was in the console: 11:23:07,407 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[facesServlet]] (http-localhost/127.0.0.1:8080-3) JBWEB000236: Servlet.service() for servlet facesServlet threw exception: java.lang.NullPointerException at com.test.userUsersDataBean.setUserAndMemberOnBackingBean(UsersDataBean.java:97) [:] at com.test.userUsersDataBean.<init>(UsersDataBean.java:109) [:]...

here's the code for UsersDataBean.java, line 97:user = userMenuBean.getUser();

userMenuBean was apparently null. eventually i found out that the problem was this, in UserMenuBean.java:@javax.enterprise.context.SessionScoped

when i changed it to this, it worked:@javax.faces.bean.SessionScoped;

UPDATE

i just got a similar Cant instantiate class error when i migrated some validator classes from faces-config.xml to using annotations. the solution was just to rebuild/recompile the project, then "Clean" the server (servers > right click on my jboss server instance > clean), then restart the server.