Skip to content

Commit 2bb1edc

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 2bb1edc

File tree

3 files changed

+71
-17
lines changed

3 files changed

+71
-17
lines changed

Jenkinsfile

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,24 +151,28 @@ 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
162-
}
154+
stage('Archive Client Bundle') {
155+
steps {
156+
container('ci') {
157+
archiveArtifacts artifacts: 'client/examples/workflow-webapp/dist/**', fingerprint: true
163158
}
164159
}
165-
stages {
166-
stage('Deploy server (P2)') {
167-
steps {
168-
build job: 'deploy-ide-p2-nightly', wait: false
169-
}
170-
171-
}
160+
}
161+
162+
stage('Deploy (master only)') {
163+
// TODO: Re-enable when condition after testing
164+
// when {
165+
// allOf {
166+
// branch 'master';
167+
// expression {
168+
// /* Only trigger the deployment job if the changeset contains changes in
169+
// the `server` or `client/packages/` directory */
170+
// sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep -q "^server"') == 0
171+
// }
172+
// }
173+
// }
174+
steps {
175+
build job: 'deploy-ide-p2-nightly', wait: false
172176
}
173177
}
174178
}

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)