[
https://issues.jboss.org/browse/JBIDE-9874?page=com.atlassian.jira.plugin...
]
Max Rydahl Andersen commented on JBIDE-9874:
--------------------------------------------
yes, its threadsafe but code would be cleaner if not that many singletons anyway.
Note, be aware that the synchronized option might have performance implications (depends
how often and concurrently it is called) and the static final approach is non-lazy so if
the constructor do work it might be too early.
Note in any of these if multiple threads loads and write it there can be problems there
anyway.
An alternative is simply to create or lookup these BehaviourModel's only when creating
objects that need them and then just hold on to them during their lifecycle. Avoids any
thread synchrionization issue since no shared state.
Weird NPE when publishing
-------------------------
Key: JBIDE-9874
URL:
https://issues.jboss.org/browse/JBIDE-9874
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: JBossAS/Servers
Reporter: Max Rydahl Andersen
Assignee: Rob Stryker
Fix For: 3.3.0.Beta1
Run as on a new project on AS7 and I got this:
java.lang.NullPointerException
at
org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel.getPublishMethodType(BehaviourModel.java:39)
at
org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.getCurrentDeploymentMethodType(DeploymentPreferenceLoader.java:54)
at
org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.getCurrentDeploymentMethodType(DeploymentPreferenceLoader.java:50)
at
org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior.createPublishMethod(DeployableServerBehavior.java:110)
at
org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior.getOrCreatePublishMethod(DeployableServerBehavior.java:64)
at
org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior.publishStart(DeployableServerBehavior.java:57)
at
org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:927)
at
org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3027)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:341)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
project still seem to deploy.
This is from what is in nightly build.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira