Skip to content

Commit 809f646

Browse files
committed
GLSP-1604: fix potentiall NPE (#119)
Add nullcheck to FocucsAwareBrowser to avoid a potential NPE Fixes eclipse-glsp/glsp/issues/1604
1 parent 7ad6f24 commit 809f646

File tree

3 files changed

+73
-17
lines changed

3 files changed

+73
-17
lines changed

Jenkinsfile

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pipeline {
106106
if (sh(returnStatus: true, script: 'git diff --name-only | grep -q "^client/yarn.lock"') == 0) {
107107
echo 'The yarn.lock file has uncommited changes!'
108108
error 'The yarn.lock file has uncommited changes!'
109-
}
109+
}
110110
}
111111
}
112112
}
@@ -151,24 +151,30 @@ pipeline {
151151
}
152152
}
153153

154-
stage('Deploy (master only)') {
155-
when {
156-
allOf {
157-
branch 'master';
158-
expression {
159-
/* Only trigger the deployment job if the changeset contains changes in
160-
the `server` or `client/packages/` directory */
161-
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep -q "^server"') == 0
154+
stage('Archive Client Bundle') {
155+
steps {
156+
container('ci') {
157+
dir('client/examples/workflow-webapp') {
158+
archiveArtifacts artifacts: 'dist/**', fingerprint: true
162159
}
163160
}
164161
}
165-
stages {
166-
stage('Deploy server (P2)') {
167-
steps {
168-
build job: 'deploy-ide-p2-nightly', wait: false
169-
}
170-
171-
}
162+
}
163+
164+
stage('Deploy (master only)') {
165+
// TODO: Re-enable when condition after testing
166+
// when {
167+
// allOf {
168+
// branch 'master';
169+
// expression {
170+
// /* Only trigger the deployment job if the changeset contains changes in
171+
// the `server` or `client/packages/` directory */
172+
// sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep -q "^server"') == 0
173+
// }
174+
// }
175+
// }
176+
steps {
177+
build job: 'deploy-ide-p2-nightly', wait: false
172178
}
173179
}
174180
}

deploy-ide-p2-nightly.Jenkinsfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
pipeline {
2+
agent any
3+
tools {
4+
maven 'apache-maven-latest'
5+
jdk 'openjdk-jdk21-latest'
6+
}
7+
8+
environment {
9+
EMAIL_TO= "glsp-build@eclipse.org"
10+
}
11+
12+
stages {
13+
14+
stage('Checkout master'){
15+
steps {
16+
timeout(30){
17+
git branch: 'master', credentialsId: 'github-bot', url: 'https://github.com/eclipse-glsp/glsp-eclipse-integration.git'
18+
}
19+
}
20+
}
21+
22+
stage('Copy Client Bundle') {
23+
steps {
24+
copyArtifacts(
25+
projectName: 'glsp-eclipse-integration/master',
26+
selector: lastSuccessful(),
27+
filter: 'client/examples/workflow-webapp/dist/**',
28+
flatten: false
29+
)
30+
// Copy the webapp bundle to the server plugin's diagram directory
31+
sh '''
32+
rm -rf server/example/org.eclipse.glsp.ide.workflow.editor/diagram/*
33+
cp -r client/examples/workflow-webapp/dist/* server/example/org.eclipse.glsp.ide.workflow.editor/diagram/
34+
'''
35+
}
36+
}
37+
38+
stage('Deploy P2') {
39+
steps {
40+
dir("server") {
41+
sh "rm -rf ${WORKSPACE}/p2-update-site/ide/p2"
42+
sh "mkdir -p ${WORKSPACE}/p2-update-site/ide/p2/nightly"
43+
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
44+
sh "mvn clean install -Prelease -B -Dlocal.p2.root=${WORKSPACE}/p2-update-site"
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}

server/plugins/org.eclipse.glsp.ide.editor/src/org/eclipse/glsp/ide/editor/ui/FocusAwareBrowser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void focusGained(final FocusEvent e) {
4747

4848
@Override
4949
public boolean isFocusControl() {
50-
if (!focusTracker.get()) {
50+
if (focusTracker != null && !focusTracker.get()) {
5151
return false;
5252
}
5353
return super.isFocusControl();

0 commit comments

Comments
 (0)