Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
NetBeans
Apache NetBeans
Commits
631bd69c
Unverified
Commit
631bd69c
authored
May 27, 2020
by
Eric Barboni
Committed by
GitHub
May 27, 2020
Browse files
Merge pull request #2159 from apache/master
Sync master to release 12.0 beta 6
parents
16abbbfa
37fba0ac
Changes
9
Hide whitespace changes
Inline
Side-by-side
apisupport/apisupport.wizards/src/org/netbeans/modules/apisupport/project/ui/wizard/action/DataModel.java
View file @
631bd69c
...
...
@@ -21,9 +21,7 @@ package org.netbeans.modules.apisupport.project.ui.wizard.action;
import
java.io.File
;
import
java.io.IOException
;
import
java.lang.reflect.InvocationHandler
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Proxy
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
...
...
@@ -40,7 +38,6 @@ import org.netbeans.api.project.Project;
import
org.netbeans.modules.apisupport.project.ui.wizard.common.CreatedModifiedFiles
;
import
org.netbeans.modules.apisupport.project.ui.wizard.common.BasicWizardIterator
;
import
org.openide.WizardDescriptor
;
import
org.openide.awt.ActionReference
;
import
org.openide.filesystems.FileObject
;
import
org.openide.filesystems.FileSystem
;
import
org.openide.filesystems.FileUtil
;
...
...
@@ -253,7 +250,7 @@ final class DataModel extends BasicWizardIterator.BasicDataModel {
}
if
(
annotations
)
{
List
<
ActionReference
>
refs
=
new
ArrayList
<
ActionReference
>();
List
<
ActionReference
Model
>
refs
=
new
ArrayList
<>();
// create layer entry for global menu item
if
(
globalMenuItemEnabled
)
{
refs
.
add
(
createActionReference
(
...
...
@@ -624,46 +621,58 @@ final class DataModel extends BasicWizardIterator.BasicDataModel {
this
.
edContextSeparatorBefore
=
separator
;
}
static
ActionReference
createActionReference
(
static
class
ActionReferenceModel
implements
Serializable
{
String
parentPath
;
String
name
;
int
beforeSep
;
int
afterSep
;
int
position
;
public
ActionReferenceModel
(
String
parentPath
,
String
name
,
int
beforeSep
,
int
afterSep
,
int
position
)
{
this
.
parentPath
=
parentPath
;
this
.
name
=
name
;
this
.
beforeSep
=
beforeSep
;
this
.
afterSep
=
afterSep
;
this
.
position
=
position
;
}
public
String
path
()
{
return
parentPath
;
}
public
int
position
()
{
return
position
;
}
public
String
name
()
{
return
name
==
null
?
""
:
name
;
}
public
int
separatorBefore
()
{
return
beforeSep
;
}
public
int
separatorAfter
()
{
return
afterSep
;
}
@Override
public
String
toString
()
{
return
"ActionReferenceModel{"
+
"parentPath="
+
parentPath
+
", name="
+
name
+
", beforeSep="
+
beforeSep
+
", afterSep="
+
afterSep
+
", position="
+
position
+
'}'
;
}
}
static
ActionReferenceModel
createActionReference
(
final
String
parentPath
,
final
int
beforeSep
,
final
int
afterSep
,
final
int
position
,
final
String
name
)
{
class
H
implements
InvocationHandler
{
@Override
public
Object
invoke
(
Object
proxy
,
Method
method
,
Object
[]
args
)
throws
Throwable
{
if
(
method
.
getName
().
equals
(
"path"
))
{
return
parentPath
;
}
if
(
method
.
getName
().
equals
(
"position"
))
{
return
position
;
}
if
(
method
.
getName
().
equals
(
"separatorBefore"
))
{
return
beforeSep
;
}
if
(
method
.
getName
().
equals
(
"separatorAfter"
))
{
return
afterSep
;
}
if
(
method
.
getName
().
equals
(
"name"
))
{
return
name
==
null
?
""
:
name
;
}
if
(
method
.
getName
().
equals
(
"equals"
))
{
return
this
==
Proxy
.
getInvocationHandler
(
proxy
);
}
if
(
method
.
getName
().
equals
(
"hashCode"
))
{
return
hashCode
();
}
return
null
;
}
}
return
(
ActionReference
)
Proxy
.
newProxyInstance
(
ActionReference
.
class
.
getClassLoader
(),
new
Class
[]
{
ActionReference
.
class
},
new
H
()
);
return
new
ActionReferenceModel
(
parentPath
,
name
,
beforeSep
,
afterSep
,
position
);
}
void
setSFS
(
FileSystem
sfs
)
{
...
...
apisupport/apisupport.wizards/test/unit/src/org/netbeans/modules/apisupport/project/ui/wizard/action/DataModelTest.java
View file @
631bd69c
...
...
@@ -20,7 +20,7 @@
package
org.netbeans.modules.apisupport.project.ui.wizard.action
;
import
org.netbeans.junit.NbTestCase
;
import
org.
openide.awt
.ActionReference
;
import
org.
netbeans.modules.apisupport.project.ui.wizard.action.DataModel
.ActionReference
Model
;
/**
* Tests {@link DataModel}.
...
...
@@ -34,7 +34,7 @@ public class DataModelTest extends NbTestCase {
}
public
void
testActionReferenceCreate
()
throws
Exception
{
ActionReference
res
=
DataModel
.
createActionReference
(
"mypath/sub"
,
30
,
130
,
100
,
"myname"
);
ActionReference
Model
res
=
DataModel
.
createActionReference
(
"mypath/sub"
,
30
,
130
,
100
,
"myname"
);
assertEquals
(
"mypath/sub"
,
res
.
path
());
assertEquals
(
100
,
res
.
position
());
assertEquals
(
"myname"
,
res
.
name
());
...
...
ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlLexer.java
View file @
631bd69c
...
...
@@ -468,6 +468,12 @@ public final class YamlLexer implements Lexer<YamlTokenId> {
case
ISA_CURLY:
state
=
ISI_WHITESPACE
;
return
token
(
YamlTokenId
.
TEXT
);
case
ISI_MUSTACHE:
state
=
ISI_WHITESPACE
;
return
token
(
YamlTokenId
.
MUSTACHE
);
case
ISI_MUSTACHE_QUOTE:
state
=
ISI_WHITESPACE
;
return
token
(
YamlTokenId
.
MUSTACHE
);
case
ISI_PHP:
state
=
ISI_WHITESPACE
;
return
token
(
YamlTokenId
.
PHP
);
...
...
ide/languages.yaml/test/unit/data/testfiles/issue_NETBEANS-4370_1.yaml.txt
0 → 100644
View file @
631bd69c
.t.e.s.t. SimpleMustache
k: {{a
.e.o.f.
\ No newline at end of file
ide/languages.yaml/test/unit/data/testfiles/issue_NETBEANS-4370_1.yaml.txt.tokens.txt
0 → 100644
View file @
631bd69c
.t.e.s.t. SimpleMustache
TEXT "k: ", la=2, st=0
MUSTACHE_DELIMITER "{{", st=13
MUSTACHE "a", la=1, st=0
----- EOF -----
<Unnamed test>
----- EOF -----
ide/languages.yaml/test/unit/data/testfiles/issue_NETBEANS-4370_2.yaml.txt
0 → 100644
View file @
631bd69c
.t.e.s.t. SimpleMustacheQuote
k: {{ '}}
.e.o.f.
\ No newline at end of file
ide/languages.yaml/test/unit/data/testfiles/issue_NETBEANS-4370_2.yaml.txt.tokens.txt
0 → 100644
View file @
631bd69c
.t.e.s.t. SimpleMustacheQuote
TEXT "k: ", la=2, st=0
MUSTACHE_DELIMITER "{{", st=13
MUSTACHE " '}}", la=1, st=0
----- EOF -----
<Unnamed test>
----- EOF -----
ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlLexerTest.java
View file @
631bd69c
...
...
@@ -65,7 +65,17 @@ public class YamlLexerTest extends YamlTestBase {
YamlTokenId
.
language
());
}
public
void
testIssue246124
()
throws
Exception
{
public
void
testNETBEANS_4370_1
()
throws
Exception
{
LexerTestUtilities
.
checkTokenDump
(
this
,
"testfiles/issue_NETBEANS-4370_1.yaml.txt"
,
YamlTokenId
.
language
());
}
public
void
testNETBEANS_4370_2
()
throws
Exception
{
LexerTestUtilities
.
checkTokenDump
(
this
,
"testfiles/issue_NETBEANS-4370_2.yaml.txt"
,
YamlTokenId
.
language
());
}
public
void
testIssue246124
()
throws
Exception
{
LexerTestUtilities
.
checkTokenDump
(
this
,
"testfiles/issue246124.yaml"
,
YamlTokenId
.
language
());
}
...
...
java/java.source.base/src/org/netbeans/modules/java/source/parsing/ParameterNameProviderImpl.java
View file @
631bd69c
...
...
@@ -208,7 +208,7 @@ public class ParameterNameProviderImpl {
static
void
capCache
(
LinkedHashMap
<
String
,
?>
map
)
{
Iterator
<
String
>
it
=
map
.
keySet
().
iterator
();
while
(
map
.
size
()
>
MAX_CACHE_SIZE
)
{
while
(
map
.
size
()
>
MAX_CACHE_SIZE
&&
it
.
hasNext
()
)
{
it
.
next
();
it
.
remove
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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