Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
NetBeans
Apache NetBeans
Commits
c4f2d871
Unverified
Commit
c4f2d871
authored
May 30, 2022
by
Eric Barboni
Committed by
GitHub
May 30, 2022
Browse files
Merge pull request #4150 from apache/delivery
Sync delivery to release140 for 14-rc6
parents
0bf8e0f0
cc14a920
Changes
5
Hide whitespace changes
Inline
Side-by-side
java/maven/src/org/netbeans/modules/maven/newproject/TemplateUtils.java
View file @
c4f2d871
...
...
@@ -255,27 +255,29 @@ public final class TemplateUtils {
POMModel
model
=
POMModelFactory
.
getDefault
().
getModel
(
modelSource
);
org
.
netbeans
.
modules
.
maven
.
model
.
pom
.
Project
root
=
model
.
getProject
();
if
(
root
!=
null
)
{
if
(
model
.
startTransaction
())
{
try
{
org
.
netbeans
.
modules
.
maven
.
model
.
pom
.
Properties
props
=
root
.
getProperties
();
if
(
props
==
null
)
{
props
=
model
.
getFactory
().
createProperties
();
root
.
setProperties
(
props
);
}
String
packageName
=
(
String
)
properties
.
get
(
TemplateUtils
.
PARAM_PACKAGE
);
String
mainClass
=
(
String
)
properties
.
get
(
TemplateUtils
.
PARAM_MAIN_CLASS_NAME
);
if
(
mainClass
==
null
||
mainClass
.
isEmpty
())
{
mainClass
=
"App"
;
// NOI18N
}
if
(
packageName
!=
null
&&
!
packageName
.
isEmpty
())
{
mainClass
=
packageName
+
'.'
+
mainClass
;
}
props
.
setProperty
(
"exec.mainClass"
,
mainClass
);
// NOI18N
}
finally
{
model
.
endTransaction
();
if
(
model
.
getProject
().
getPackaging
()
==
null
||
"jar"
.
equals
(
model
.
getProject
().
getPackaging
()))
{
if
(
model
.
startTransaction
())
{
try
{
Utilities
.
saveChanges
(
model
);
}
catch
(
IOException
ex
)
{}
org
.
netbeans
.
modules
.
maven
.
model
.
pom
.
Properties
props
=
root
.
getProperties
();
if
(
props
==
null
)
{
props
=
model
.
getFactory
().
createProperties
();
root
.
setProperties
(
props
);
}
String
packageName
=
(
String
)
properties
.
get
(
TemplateUtils
.
PARAM_PACKAGE
);
String
mainClass
=
(
String
)
properties
.
get
(
TemplateUtils
.
PARAM_MAIN_CLASS_NAME
);
if
(
mainClass
==
null
||
mainClass
.
isEmpty
())
{
mainClass
=
"App"
;
// NOI18N
}
if
(
packageName
!=
null
&&
!
packageName
.
isEmpty
())
{
mainClass
=
packageName
+
'.'
+
mainClass
;
}
props
.
setProperty
(
"exec.mainClass"
,
mainClass
);
// NOI18N
}
finally
{
model
.
endTransaction
();
try
{
Utilities
.
saveChanges
(
model
);
}
catch
(
IOException
ex
)
{}
}
}
}
}
...
...
java/maven/src/org/netbeans/modules/maven/newproject/idenative/IDENativeMavenWizardIterator.java
View file @
c4f2d871
...
...
@@ -93,6 +93,7 @@ public abstract class IDENativeMavenWizardIterator implements WizardDescriptor.I
return
new
FileBuilder
(
w
.
getTemplate
().
getPrimaryFile
(),
w
.
getTargetFolder
().
getPrimaryFile
().
getParent
()).
param
(
TemplateUtils
.
PARAM_PACKAGE
,
(
String
)
wiz
.
getProperty
(
"package"
)).
param
(
TemplateUtils
.
PARAM_PACKAGING
,
(
String
)
this
.
packaging
).
defaultMode
(
FileBuilder
.
Mode
.
COPY
).
name
(
w
.
getTargetName
()).
useLookup
(
Lookups
.
fixed
(
h
));
...
...
java/maven/src/org/netbeans/modules/maven/newproject/idenative/IDENativeTemplateHandler.java
View file @
c4f2d871
...
...
@@ -122,15 +122,18 @@ public class IDENativeTemplateHandler extends CreateFromTemplateHandler {
params
.
put
(
"projecName"
,
cd
.
getName
());
params
.
put
(
"packagePath"
,
pi
.
packageName
==
null
?
""
:
pi
.
packageName
.
replace
(
'.'
,
'/'
));
// NOI18N
String
mainName
;
if
(!
params
.
containsKey
(
"mainClassName"
))
{
// NOI18N
String
derived
=
deriveClassName
(
pi
.
artifactId
);
if
(
BaseUtilities
.
isJavaIdentifier
(
derived
))
{
mainName
=
derived
;
}
else
{
mainName
=
"App"
;
// NOI18N
String
packaging
=
cd
.
getValue
(
TemplateUtils
.
PARAM_PACKAGING
);
if
(
packaging
==
null
||
"jar"
.
equals
(
packaging
))
{
// NOI18N
String
mainName
;
if
(!
params
.
containsKey
(
"mainClassName"
))
{
// NOI18N
String
derived
=
deriveClassName
(
pi
.
artifactId
);
if
(
BaseUtilities
.
isJavaIdentifier
(
derived
))
{
mainName
=
derived
;
}
else
{
mainName
=
"App"
;
// NOI18N
}
params
.
put
(
"mainClassName"
,
mainName
);
// NOI18N
}
params
.
put
(
"mainClassName"
,
mainName
);
// NOI18N
}
...
...
java/maven/src/org/netbeans/modules/maven/newproject/idenative/PomJavaNativeMWI.java
View file @
c4f2d871
...
...
@@ -28,7 +28,14 @@ import org.openide.util.NbBundle;
*
* @author mkleint
*/
@TemplateRegistration
(
folder
=
ArchetypeWizards
.
TEMPLATE_FOLDER
,
position
=
980
,
displayName
=
"#LBL_Maven_POM_Archetype"
,
iconBase
=
"org/netbeans/modules/maven/resources/Maven2Icon.gif"
,
description
=
"pom-root.html"
)
@TemplateRegistration
(
displayName
=
"#LBL_Maven_POM_Archetype"
,
iconBase
=
"org/netbeans/modules/maven/resources/Maven2Icon.gif"
,
description
=
"pom-root.html"
,
folder
=
ArchetypeWizards
.
TEMPLATE_FOLDER
,
position
=
980
,
createHandlerClass
=
IDENativeTemplateHandler
.
class
)
@NbBundle
.
Messages
(
"LBL_Maven_POM_Archetype=POM Project"
)
public
class
PomJavaNativeMWI
extends
IDENativeMavenWizardIterator
{
...
...
platform/openide.util.lookup/src/org/openide/util/lookup/implspi/ActiveQueue.java
View file @
c4f2d871
...
...
@@ -57,17 +57,23 @@ public final class ActiveQueue {
}
@Override
public
Reference
<
Object
>
remove
(
long
timeout
)
throws
IllegalArgumentException
,
InterruptedException
{
throw
new
InterruptedException
();
public
Reference
<?
extends
Object
>
remove
(
long
timeout
)
throws
IllegalArgumentException
,
InterruptedException
{
if
(
timeout
<
0
)
{
throw
new
IllegalArgumentException
(
"Negative timeout value"
);
}
else
if
(
Thread
.
currentThread
()
!=
Daemon
.
running
)
{
throw
new
InterruptedException
();
}
return
super
.
remove
(
timeout
);
}
@Override
public
Reference
<
Object
>
remove
()
throws
InterruptedException
{
throw
new
InterruptedException
();
}
final
Reference
<?
extends
Object
>
removeSuper
()
throws
InterruptedException
{
return
super
.
remove
(
0
);
public
Reference
<
?
extends
Object
>
remove
()
throws
InterruptedException
{
if
(
Thread
.
currentThread
()
!=
Daemon
.
running
)
{
throw
new
InterruptedException
();
}
return
super
.
remove
();
}
}
...
...
@@ -112,7 +118,7 @@ public final class ActiveQueue {
if
(
impl
==
null
)
{
return
;
}
Reference
<?>
ref
=
impl
.
remove
Super
();
Reference
<?>
ref
=
impl
.
remove
();
LOGGER
.
log
(
Level
.
FINE
,
"Got dequeued reference {0}"
,
new
Object
[]
{
ref
});
if
(!(
ref
instanceof
Runnable
))
{
LOGGER
.
log
(
Level
.
WARNING
,
"A reference not implementing runnable has been added to the Utilities.activeReferenceQueue(): {0}"
,
ref
.
getClass
());
...
...
@@ -131,9 +137,8 @@ public final class ActiveQueue {
// to allow GC
ref
=
null
;
}
}
catch
(
InterruptedException
ex
)
{
// Can happen during VM shutdown, it seems. Ignore.
continue
;
}
catch
(
InterruptedException
ignored
)
{
// Can happen during VM shutdown, it seems.
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment