Skip to content

Commit

Permalink
Merge pull request #4506 from apache/delivery
Browse files Browse the repository at this point in the history
Sync delivery to release150 for 15-rc4
  • Loading branch information
neilcsmith-net authored Aug 16, 2022
2 parents 8156d3f + ceffbbc commit 387759c
Show file tree
Hide file tree
Showing 28 changed files with 203 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,18 @@ public Set<GradleDependency.ModuleDependency> findModules(String gav) throws Ill
}

/**
* Returns {@code true} if all configurations are resolved.
* @return true - if all configurations are resolved.
* Returns {@code true} if all resolvable configurations are resolved.
* @return true - if all resolvable configurations are resolved.
*/
public boolean isResolved() {
if (resolved == null) {
boolean b = true;
for (GradleConfiguration value : configurations.values()) {
b &= value.isResolved();
if (!b) {
break;
if (value.isCanBeResolved()) {
b &= value.isResolved();
if (!b) {
break;
}
}
}
resolved = b;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,16 @@ public void dispatchURL (DisplayTask task) {
}

logFine("urlstr:", urlStr); // NOI18N
StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage (NbDdeBrowserImpl.class, "MSG_activatingBrowser"));
try {
task.browser.reqDdeMessage(task.browser.realDDEServer(),WWW_ACTIVATE,"-1,0x0",task.browser.getActivateTimeout());
} catch (NbBrowserException ex) {
logFine("Exception, gonna start browser:", ex);
triedStart = true;
startBrowser(task.browser.extBrowserFactory.getBrowserExecutable(), urlStr);
}
if (!win9xHack(task.browser.realDDEServer())) {
StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage (NbDdeBrowserImpl.class, "MSG_activatingBrowser"));
try {
task.browser.reqDdeMessage(task.browser.realDDEServer(),WWW_ACTIVATE,"-1,0x0",task.browser.getActivateTimeout());
} catch (NbBrowserException ex) {
logFine("Exception, gonna start browser:", ex);
triedStart = true;
startBrowser(task.browser.extBrowserFactory.getBrowserExecutable(), urlStr);
}
}
logFine("firstpart"); // NOI18N

if (!triedStart) {
Expand Down Expand Up @@ -443,6 +445,15 @@ private String getFileUrl(String url) {
return url;
}

/**
* Checks for IExplorer & Win9x combination.
*/
private boolean win9xHack (String browser) {
return browser.equals(ExtWebBrowser.IEXPLORE)
&& (Utilities.getOperatingSystem() == Utilities.OS_WIN98
|| Utilities.getOperatingSystem() == Utilities.OS_WIN95);
}

/**
* Utility function that tries to start new browser process.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ Link to<A HREF="overview-summary.html">Non-frame version.</A>
<!-- possibly after filtering for duplicates or something like this. -->
<!-- Timeout is ten minutes; should be enough for valid start, while preventing -->
<!-- a deadlock from hanging an automated build: -->
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
Expand Down Expand Up @@ -828,7 +828,7 @@ Link to<A HREF="overview-summary.html">Non-frame version.</A>
>
<property name="tryme.debug.args" value="" />

<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ PKGINST=${pkg.svr4.pkginst}</echo>
<!-- possibly after filtering for duplicates or something like this. -->
<!-- Timeout is ten minutes; should be enough for valid start, while preventing -->
<!-- a deadlock from hanging an automated build: -->
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
Expand Down Expand Up @@ -828,7 +828,7 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d
>
<property name="tryme.debug.args" value="" />

<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ Link to<A HREF="overview-summary.html">Non-frame version.</A>
<!-- possibly after filtering for duplicates or something like this. -->
<!-- Timeout is ten minutes; should be enough for valid start, while preventing -->
<!-- a deadlock from hanging an automated build: -->
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
Expand Down Expand Up @@ -828,7 +828,7 @@ Link to<A HREF="overview-summary.html">Non-frame version.</A>
>
<property name="tryme.debug.args" value="" />

<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ PKGINST=${pkg.svr4.pkginst}</echo>
<!-- possibly after filtering for duplicates or something like this. -->
<!-- Timeout is ten minutes; should be enough for valid start, while preventing -->
<!-- a deadlock from hanging an automated build: -->
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
Expand Down Expand Up @@ -828,7 +828,7 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d
>
<property name="tryme.debug.args" value="" />

<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3380,6 +3380,8 @@ public boolean accept(Element e, TypeMirror t) {
addAllStaticMemberNames(env);
}
final TypeElement enclClass = scope.getEnclosingClass();
List<ExecutableElement> methodsIn = null;

for (Element e : locals) {
switch (simplifyElementKind(e.getKind())) {
case ENUM_CONSTANT:
Expand All @@ -3399,8 +3401,11 @@ public boolean accept(Element e, TypeMirror t) {
}
break;
case METHOD:
if (methodsIn == null) {
methodsIn = ElementFilter.methodsIn(locals);
}
ExecutableType et = (ExecutableType) asMemberOf(e, enclClass != null ? enclClass.asType() : null, types);
if (e.getEnclosingElement() != enclClass && conflictsWithLocal(e.getSimpleName(), enclClass, locals)) {
if (e.getEnclosingElement() != enclClass && conflictsWithLocalMethods(e.getSimpleName(), enclClass, methodsIn)) {
results.add(itemFactory.createStaticMemberItem(env.getController(), (DeclaredType)e.getEnclosingElement().asType(), e, et, false, anchorOffset, elements.isDeprecated(e), env.addSemicolon()));
} else {
results.add(itemFactory.createExecutableItem(env.getController(), (ExecutableElement) e, et, anchorOffset, null, env.getScope().getEnclosingClass() != e.getEnclosingElement(), elements.isDeprecated(e), false, env.addSemicolon(), isOfSmartType(env, getCorrectedReturnType(env, et, (ExecutableElement) e, enclClass != null ? enclClass.asType() : null), smartTypes), env.assignToVarPos(), false));
Expand Down Expand Up @@ -6216,9 +6221,9 @@ private boolean hasAccessibleInnerClassConstructor(Element e, Scope scope, Trees
}
return false;
}
private boolean conflictsWithLocal(Name name, TypeElement enclClass, Iterable<? extends Element> locals) {
for (ExecutableElement local : ElementFilter.methodsIn(locals)) {

private static boolean conflictsWithLocalMethods(Name name, TypeElement enclClass, List<ExecutableElement> methodsIn) {
for (ExecutableElement local : methodsIn) {
if (local.getEnclosingElement() == enclClass && name.contentEquals(local.getSimpleName())) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.netbeans.modules.java.hints.bugs;

import com.sun.source.tree.Tree.Kind;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.lang.model.element.ElementKind;
Expand Down Expand Up @@ -46,11 +47,18 @@ public class Unused {

@TriggerTreeKind(Kind.COMPILATION_UNIT)
public static List<ErrorDescription> unused(HintContext ctx) {
return UnusedDetector.findUnused(ctx.getInfo(), () -> ctx.isCanceled())
.stream()
.map(ud -> convertUnused(ctx, ud))
.filter(err -> err != null)
.collect(Collectors.toList());
List<UnusedDescription> unused = UnusedDetector.findUnused(ctx.getInfo(), () -> ctx.isCanceled());
List<ErrorDescription> result = new ArrayList<>(unused.size());
for (UnusedDescription ud : unused) {
if (ctx.isCanceled()) {
break;
}
ErrorDescription err = convertUnused(ctx, ud);
if (err != null) {
result.add(err);
}
}
return result;
}

@Messages({
Expand Down
6 changes: 3 additions & 3 deletions java/performance/sparrow/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
depends="create-userdir,add-userdir">
<echo>Warmup 1 - running IDE once to prime disk and memory caches and create userdir</echo>

<exec os="Windows NT Windows 2000 Windows XP"
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP"
executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000">
<arg value="-J-Dnetbeans.close=true"/>
</exec>
Expand All @@ -123,7 +123,7 @@
</exec>

<echo>Warmup 2 - running IDE a second time prime disk and memory caches and create userdir</echo>
<exec os="Windows NT Windows 2000 Windows XP"
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP"
executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000">
<arg value="-J-Dnetbeans.close=true"/>
</exec>
Expand Down Expand Up @@ -305,7 +305,7 @@ Copying ide.log</echo>
<target name="runide-freshuserdir" depends="delete-userdir,create-userdir,runide" />

<target name="runide" description="Start the IDE with the userdir specified in the userdir property">
<exec os="Windows NT Windows 2000 Windows XP"
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP"
executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000"
output="${gclog}_${index}">
</exec>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
# {0} - class name of exception
# {1} - path to system folder
NTF_ExceptionalException=\
A {0} exception has occurred.\n\
Please report this at https://netbeans.apache.org/nb/report-issue,\n\
including a copy of your messages.log file as an attachment.\n\
The messages.log file is located in your {1} folder.
A <code>{0}</code> has occurred.<br/><br/>\
If you are running the <a href="https://netbeans.apache.org/download">latest</a> version of NetBeans you can \
<a href="https://netbeans.apache.org/nb/report-issue">report this</a>, \
including a copy of your messages.log file as an attachment.<br/><br/>\
The messages.log file is located in <a href="{1}">this folder</a>.

NTF_ExceptionalExceptionReport=Show and Report Problem to NetBeans Team
NTF_ExceptionalExceptionReport=Show Details
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fi
appSigningIdentity="$1"
appDir="$2"

nativeExecutionBinaries=( "/netbeans/ide/bin/nativeexecution/MacOSX-x86/unbuffer.dylib" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/pty" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/pty_open" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/process_start" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/killall" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/stat" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/unbuffer.dylib" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/pty" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/pty_open" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/process_start" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/killall" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/stat")
nativeExecutionBinaries=( "/netbeans/ide/bin/nativeexecution/MacOSX-x86/unbuffer.dylib" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/pty" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/pty_open" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/process_start" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/killall" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/stat" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/unbuffer.dylib" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/pty" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/pty_open" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/process_start" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/killall" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/stat" "/netbeans/ide/modules/lib/aarch64/libjunixsocket-native-2.5.1.dylib" "/netbeans/ide/modules/lib/x86_64/libjunixsocket-native-2.5.1.dylib")
jniBinaries=("/netbeans/platform/modules/lib/aarch64/libjnidispatch-nb.jnilib" "/netbeans/platform/modules/lib/x86_64/libjnidispatch-nb.jnilib")
profilerBinaries=("/netbeans/profiler/lib/deployed/jdk16/mac/libprofilerinterface.jnilib" "/netbeans/profiler/lib/deployed/jdk15/mac/libprofilerinterface.jnilib" )
jansiJar="/netbeans/java/maven/lib/jansi-2.4.0.jar"
Expand Down
1 change: 1 addition & 0 deletions nbi/engine/native/launcher/windows/src/ExtractUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ void skipStub(LauncherProperties * props) {
WCHAR * os;
props->status = EXIT_CODE_STUB;
os = appendStringW(NULL, L"It`s only the launcher stub.\nOS: ");
if(is9x()) os = appendStringW(os, L"Windows 9x");
if(isNT()) os = appendStringW(os, L"Windows NT");
if(is2k()) os = appendStringW(os, L"Windows 2000");
if(isXP()) os = appendStringW(os, L"Windows XP");
Expand Down
31 changes: 18 additions & 13 deletions nbi/engine/native/launcher/windows/src/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,22 +634,27 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hi, LPSTR lpCmdLine, int nCmd
globalInstance = hInstance;
UNREFERENCED_PARAMETER(lpCmdLine);
initWow64();
if(!createEvents()) {
status = EXIT_CODE_EVENTS_INITIALIZATION_ERROR;
if(is9x()) {
MessageBoxA(0, "Windows 9X platform is not supported", "Message", MB_OK);
status = EXIT_CODE_SYSTEM_ERROR;
} else {
LauncherProperties * props = createLauncherProperties();
createLauncherThread(props);
if(!createGui(props, hInstance, hi, nCmdShow)) {
status = EXIT_CODE_GUI_INITIALIZATION_ERROR;
if(!createEvents()) {
status = EXIT_CODE_EVENTS_INITIALIZATION_ERROR;
} else {
messageLoop(props);
WaitForSingleObject(closingWindowsConfirmed, INFINITE);
LauncherProperties * props = createLauncherProperties();
createLauncherThread(props);
if(!createGui(props, hInstance, hi, nCmdShow)) {
status = EXIT_CODE_GUI_INITIALIZATION_ERROR;
} else {
messageLoop(props);
WaitForSingleObject(closingWindowsConfirmed, INFINITE);
}

status = props->status;
exitCode = props->exitCode;
printStatus(props);
freeLauncherProperties(&props);
}

status = props->status;
exitCode = props->exitCode;
printStatus(props);
freeLauncherProperties(&props);
}
FREE(currentProgressSize);
FREE(totalProgressSize);
Expand Down
5 changes: 5 additions & 0 deletions nbi/engine/native/launcher/windows/src/SystemUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ void getOSVersion(DWORD *id, DWORD *major, DWORD *minor, DWORD *productType) {
return;
}

DWORD is9x() {
DWORD id, major, minor, type;
getOSVersion(& id, & major, & minor, & type);
return (id == VER_PLATFORM_WIN32_WINDOWS) ? 1 : 0;
}
DWORD isNT() {
DWORD id, major, minor, type;
getOSVersion(& id, & major, & minor, & type);
Expand Down
1 change: 1 addition & 0 deletions nbi/engine/native/launcher/windows/src/SystemUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
extern "C" {
#endif

DWORD is9x();
DWORD isNT();
DWORD isXP();
DWORD is2k();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ class OutWriter extends PrintWriter {

private boolean disposeOnClose = false;

private static final boolean USE_HEAP_STORAGE = Boolean.getBoolean("nb.output.heap");
//IZ 44375 - Memory mapping fails with bad file handle on win 98
private static final boolean USE_HEAP_STORAGE =
Boolean.getBoolean("nb.output.heap") || Utilities.getOperatingSystem() == //NOI18N
Utilities.OS_WIN98 ||
Utilities.getOperatingSystem() == Utilities.OS_WIN95;

/**
* Byte array used to write the line separator after line writes.
Expand Down
8 changes: 4 additions & 4 deletions platform/o.n.core/src/org/netbeans/core/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ OpenIDE-Module-Long-Description=\
# {0} - class name of exception
# {1} - path to system folder
NTF_ExceptionalException=\
A {0} exception has occurred.\n\
\tClick Show Details or see the messages.log file located in your {1} folder.
A {0} exception has occurred.<br/><br/>\
Click Show Details or see the messages.log file located in your {1} folder.
NTF_ExceptionalExceptionTitle=Unexpected Exception
# {0} - class name of exception
NTF_ExceptionWarning=\
A {0} exception has occurred.\n\
However, the system should continue working without further problems.\n\
A {0} exception has occurred.<br/><br/>\
However, the system should continue working without further problems.<br/><br/>\
Click Show Details for the stack trace.
NTF_ExceptionWarningTitle=Warning

Expand Down
Loading

0 comments on commit 387759c

Please sign in to comment.