Skip to content

Commit 4544959

Browse files
authored
Merge pull request #9 from secure-software-engineering/feature/suggest-methods
Release 1.3.0
2 parents 0673eb6 + 4212148 commit 4544959

File tree

6 files changed

+25
-24
lines changed

6 files changed

+25
-24
lines changed

swan_assist/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,22 @@ sourceCompatibility = 1.8
1010

1111
repositories {
1212
mavenCentral()
13-
mavenLocal()
1413
}
1514

1615
dependencies {
1716
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1'
18-
compile group:'de.upb.cs.swt', name: 'swan_core', version: '1.2.1'
17+
compile group:'de.upb.cs.swt', name: 'swan_core', version: '1.3.0'
1918
compile group: 'ca.mcgill.sable', name: 'soot', version: '3.3.0'
2019
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.5'
21-
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.5'
20+
compile group: 'org.slf4j', name: 'slf4j-simple', version : '1.7.5'
2221
testCompile group: 'junit', name: 'junit', version: '4.12'
2322
}
2423

2524
intellij {
2625
version '2018.3.6'
26+
intellij.updateSinceUntilBuild false
2727
}
28+
2829
patchPluginXml {
2930
changeNotes """
3031
Add change notes here.<br>

swan_assist/src/main/java/de/fraunhofer/iem/swan/assist/ui/dialog/PluginSettingsDialog.form

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,6 @@
4949
<text value="..."/>
5050
</properties>
5151
</component>
52-
<component id="b3a63" class="javax.swing.JLabel" binding="sourceCheckBox">
53-
<constraints>
54-
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
55-
</constraints>
56-
<properties>
57-
<horizontalAlignment value="2"/>
58-
<horizontalTextPosition value="11"/>
59-
<text resource-bundle="dialog_messages" key="Launcher.ProjectCheckBox"/>
60-
<toolTipText value="Set path for project jars and output path for SWAN files"/>
61-
</properties>
62-
</component>
6352
<component id="f8ebf" class="javax.swing.JSeparator">
6453
<constraints>
6554
<grid row="0" column="3" row-span="1" col-span="2" vsize-policy="6" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
@@ -99,9 +88,18 @@
9988
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
10089
</constraints>
10190
<properties>
91+
<selected value="false"/>
10292
<text resource-bundle="dialog_messages" key="Launcher.DefaultPath"/>
10393
</properties>
10494
</component>
95+
<component id="998b" class="javax.swing.JLabel">
96+
<constraints>
97+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
98+
</constraints>
99+
<properties>
100+
<text resource-bundle="dialog_messages" key="Launcher.ProjectCheckBox"/>
101+
</properties>
102+
</component>
105103
</children>
106104
</grid>
107105
<grid id="1ffb" binding="trainingPanel" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">

swan_assist/src/main/java/de/fraunhofer/iem/swan/assist/ui/dialog/PluginSettingsDialog.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,10 @@ public PluginSettingsDialog(Project project, boolean modal) {
9696
outputDir.setText(PropertiesComponent.getInstance(project).getValue(Constants.OUTPUT_DIRECTORY));
9797

9898
//Set value for using training path
99-
if (PropertiesComponent.getInstance(project).isValueSet(Constants.DEFAULT_TRAINING_PATH)) {
100-
101-
trainingPathCheckbox.setSelected(PropertiesComponent.getInstance(project).getBoolean(Constants.DEFAULT_TRAINING_PATH));
102-
}
99+
trainingPathCheckbox.setSelected(PropertiesComponent.getInstance(project).getBoolean(Constants.DEFAULT_TRAINING_PATH, false ));
103100

104101
for (Component component : trainingPanel.getComponents()) {
105-
component.setEnabled(!trainingPathCheckbox.isSelected());
102+
component.setEnabled(trainingPathCheckbox.isSelected());
106103
}
107104

108105
if(PropertiesComponent.getInstance(project).isValueSet(Constants.TRAIN_DIRECTORY)){
@@ -123,7 +120,7 @@ public void actionPerformed(ActionEvent e) {
123120
PropertiesComponent.getInstance(project).setValue(Constants.DEFAULT_TRAINING_PATH, trainingPathCheckbox.isSelected());
124121

125122
for (Component component : trainingPanel.getComponents()) {
126-
component.setEnabled(!trainingPathCheckbox.isSelected());
123+
component.setEnabled(trainingPathCheckbox.isSelected());
127124
}
128125
}
129126
});
@@ -165,13 +162,13 @@ protected void doOKAction() {
165162
.createHtmlTextBalloonBuilder(resourceBundle.getString("Messages.Error.PathNotFound"), MessageType.ERROR, null)
166163
.createBalloon()
167164
.show(JBPopupFactory.getInstance().guessBestPopupLocation(sourceDirTextbox), Balloon.Position.below);
168-
} else if (!trainingPathCheckbox.isSelected() && trainingTextbox.getText().isEmpty()) {
165+
} else if (trainingPathCheckbox.isSelected() && trainingTextbox.getText().isEmpty()) {
169166

170167
JBPopupFactory.getInstance()
171168
.createHtmlTextBalloonBuilder(resourceBundle.getString("Messages.Error.PathNotFound"), MessageType.ERROR, null)
172169
.createBalloon()
173170
.show(JBPopupFactory.getInstance().guessBestPopupLocation(trainingPathCheckbox), Balloon.Position.below);
174-
} else if (!trainingPathCheckbox.isSelected()) {
171+
} else if (trainingPathCheckbox.isSelected()) {
175172

176173
parameters.put(Constants.TRAIN_DIRECTORY, trainingTextbox.getText());
177174
PropertiesComponent.getInstance(project).setValue(Constants.TRAIN_DIRECTORY, trainingTextbox.getText());

swan_assist/src/main/resources/META-INF/plugin.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
<depends>com.intellij.modules.lang</depends>
1212
-->
1313

14+
<idea-version since-build="181"/>
15+
1416
<extensions defaultExtensionNs="com.intellij">
1517
<codeInsight.lineMarkerProvider language="JAVA"
1618
implementationClass="de.fraunhofer.iem.swan.assist.ui.markers.ErrorLineMarker"/>

swan_assist/src/main/resources/dialog_messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Launcher.Project = Project JAR(s)
1717
Launcher.AdvancedOptionsCheckBox = Advanced Options
1818
Launcher.Output = Output Path
1919
Launcher.TrainingJars = Training JARs
20-
Launcher.DefaultPath = Use default training JARs
20+
Launcher.DefaultPath = Use training JARs from diretory
2121

2222
#Notifications when running SWAN
2323
Messages.Title.RefreshStarted = Reloading SWAN

swan_core/pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>de.upb.cs.swt</groupId>
77
<artifactId>swan_core</artifactId>
88
<packaging>jar</packaging>
9-
<version>1.2.1</version>
9+
<version>1.3.0</version>
1010

1111
<name>SWAN Weakness Detector</name>
1212
<description>SWAN is a machine-learning approach for detection of methods of interest for security in Java libraries.</description>
@@ -166,6 +166,9 @@
166166
</plugins>
167167
</build>
168168

169+
170+
171+
169172
<!-- release build command: mvn clean install -Prelease -->
170173
<profiles>
171174
<profile>

0 commit comments

Comments
 (0)