Deutsch English Français
Your feedback:
Did you like this page? vote3 Yes
vote2 Partly
vote1 No
Your comment?

Add your email address, if you want to get a response

Your name, if you like

Do not change this:
Feedback
Search

2011-12-16

Istanbul 2011

Private
4/14
14 Pictures

Istanbul 2011
Folder date 2011-10-27
Istanbul 2011
Relevant links:
10-12-2011 03.01

2011-12-12

(Not translated)

Computer
This entry is not (yet) translated into this language. Choose one of these languages:

See also

08-12-2011 23.46

2011-12-10

Sailing in Split

Private
14/20
20 Pictures

Split 2011
Folder date 2011-09-30
Sailing in Split 2011
Relevant links:
10-12-2011 03.01

2011-12-08

Java: Foo.class.getName() does no longer initialize static blocks

Computer
Imaging you have the following to Java class with a static attribute
public class ClassWithStaticVariable
{
protected static int myNumber=0;

public static int getMyNumber()
{
return myNumber;
}

}

No you extend this class and want to initialize the static attribute of
your father in a static block (for whatever reason)
public class ClassWithStaticBlock extends ClassWithStaticVariable
{
static
{
myNumber=42;
}
public static void init() { };
}

It is obvious that if you just read the static variable of the father's
class the static init block never gets executed:
System.out.println(ClassWithStaticVariable.getMyNumber());
0

But how do you ensure it is executed? It seems to be a common practice
to execute the getName() method on the class attribute
ClassWithStaticBlock.class.getName();
System.out.println(ClassWithStaticVariable.getMyNumber());

Sadly, this stopped working after Java 1.4:
Result / Java Environment
42 / Java Vendor: Sun Microsystems Inc. Java version: 1.4.2_19 OS: x86 Windows Vista 6.1
0 / Java Vendor: Sun Microsystems Inc. Java version: 1.6.0_27 OS: x86 Windows 7 6.1
0 / Java Vendor: Oracle Corporation Java version: 1.7.0 OS: x86 Windows 7 6.1
So you better not trust static init blocks to be executed if you call
class.getName(). A reliable alternative might be to add an empty static
method to the class and call that method:
ClassWithStaticBlock.init();

This will trigger the static init block plus you can even add code to
the init method. Remember however, that this code maybe called more than
once, while your static init block normally is only executed once.
10-12-2011 13.01

2011-12-03

Java VisualVm has stopped working

Computer
With Windows 7 Java VisualVm stopped working:
Problem signature:
Problem Event Name: APPCRASH
Application Name: jvisualvm.exe
Application Version: 7.0.0.0
Application Timestamp: 4d8c6dcf
Fault Module Name: msvcrt.dll
Fault Module Version: 7.0.7600.16385
Fault Module Timestamp: 4a5bda6f
Exception Code: c0000005
Exception Offset: 00018dbd
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 1031
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt

Solution: Check if the following regkey exists and points to a valid directory:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
"AppData"="C:\\Users\\Foo\\AppData"
03-12-2011 15.05

2011-11-16

(Not translated)

Private
This entry is not (yet) translated into this language. Choose one of these languages:
16-11-2011 17.02

2011-07-01

Dachau

Private
3/13
13 Pictures

de: Dachau
Folder date 2011-05-22
de: Dachau 2011
Relevant links:
26-06-2011 23.58

2011-06-26

Thailand 2011

Private
52/114
114 Pictures

de: Thailand
Folder date 2011-04-12
de: Thailand 2011
Relevant links:
26-06-2011 23.55

2011-02-28

(Not translated)

Computer
This entry is not (yet) translated into this language. Choose one of these languages:
28-02-2011 23.19

2011-01-01

(Not translated)

LinuxDebianComputer
This entry is not (yet) translated into this language. Choose one of these languages:
30-12-2010 23.34

2010-12-22

(Not translated)

InternetComputer
This entry is not (yet) translated into this language. Choose one of these languages:

See also

22-12-2010 00.19

2010-12-14

(Not translated)

Computer
This entry is not (yet) translated into this language. Choose one of these languages:
14-12-2010 01.35

2010-11-24

(Not translated)

DebianComputer
This entry is not (yet) translated into this language. Choose one of these languages:
23-11-2010 02.47
Powered by PHP Created with Xemacs Valid rss 2.0! Valid XHTML 1.0! Valid CSS!