1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

Merge branch 'master' of github.com:arduino/Arduino

This commit is contained in:
Martino Facchin 2019-01-21 09:41:32 +01:00
commit 3ba85835bf
10 changed files with 18 additions and 17 deletions

View File

@ -42,7 +42,7 @@
<classpathentry kind="lib" path="lib/slf4j-simple-1.7.22.jar"/>
<classpathentry kind="lib" path="lib/jsch-0.1.50.jar"/>
<classpathentry kind="lib" path="lib/jssc-2.8.0-arduino2.jar"/>
<classpathentry kind="lib" path="lib/rsyntaxtextarea-2.6.1.jar"/>
<classpathentry kind="lib" path="lib/rsyntaxtextarea-3.0.3-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="lib/xml-apis-1.3.04.jar"/>
<classpathentry kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>
<classpathentry kind="lib" path="lib/xmlgraphics-commons-2.0.jar"/>

View File

@ -21,4 +21,4 @@ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Binary file not shown.

Binary file not shown.

View File

@ -98,27 +98,27 @@ public class ContributedLibraryTableCellEditor extends InstallerTableCell {
editorCell.downgradeChooser.addItem(tr("Select version"));
final List<ContributedLibrary> notInstalledPrevious = new LinkedList<>();
final List<ContributedLibrary> notIInstalledNewer = new LinkedList<>();
final List<ContributedLibrary> notInstalledNewer = new LinkedList<>();
notInstalled.stream().forEach(input -> {
if (!mayInstalled.isPresent()
|| VersionComparator.greaterThan(mayInstalled.get(), input)) {
notInstalledPrevious.add(input);
} else {
notIInstalledNewer.add(input);
notInstalledNewer.add(input);
}
});
notIInstalledNewer.forEach(editorCell.downgradeChooser::addItem);
notInstalledNewer.forEach(editorCell.downgradeChooser::addItem);
notInstalledPrevious.forEach(editorCell.downgradeChooser::addItem);
editorCell.downgradeChooser
.setVisible(mayInstalled.isPresent()
&& (!notInstalledPrevious.isEmpty()
|| notIInstalledNewer.size() > 1));
|| notInstalledNewer.size() > 1));
editorCell.downgradeButton
.setVisible(mayInstalled.isPresent()
&& (!notInstalledPrevious.isEmpty()
|| notIInstalledNewer.size() > 1));
|| notInstalledNewer.size() > 1));
editorCell.versionToInstallChooser.removeAllItems();
notInstalled.forEach(editorCell.versionToInstallChooser::addItem);

View File

@ -33,15 +33,9 @@ import java.util.Comparator;
public class DownloadableContributionVersionComparator implements Comparator<DownloadableContribution> {
private final VersionComparator versionComparator;
public DownloadableContributionVersionComparator() {
versionComparator = new VersionComparator();
}
@Override
public int compare(DownloadableContribution lib1, DownloadableContribution lib2) {
return versionComparator.compare(lib1.getParsedVersion(), lib2.getParsedVersion());
return VersionComparator.compareTo(lib1.getParsedVersion(), lib2.getParsedVersion());
}

View File

@ -61,7 +61,7 @@ public class VersionComparator implements Comparator<String> {
public static boolean greaterThan(String a, String b) {
return compareTo(a, b) > 0;
}
public static boolean greaterThanOrEqual(String a, String b) {
return compareTo(a, b) >= 0;
}
@ -77,4 +77,8 @@ public class VersionComparator implements Comparator<String> {
public static boolean greaterThan(ContributedLibrary a, ContributedLibrary b) {
return greaterThan(a.getParsedVersion(), b.getParsedVersion());
}
public static int compareTo(ContributedLibrary a, ContributedLibrary b) {
return compareTo(a.getParsedVersion(), b.getParsedVersion());
}
}

View File

@ -344,6 +344,9 @@ public class FileUtils {
public static List<File> listFiles(File folder, boolean recursive,
List<String> extensions) {
List<File> result = new ArrayList<>();
if (!folder.exists()) {
return result;
}
for (File file : folder.listFiles()) {
if (isSCCSOrHiddenFile(file))

View File

@ -50,7 +50,7 @@
<cp>%EXEDIR%/lib/jsch-0.1.50.jar</cp>
<cp>%EXEDIR%/lib/jssc-2.8.0-arduino2.jar</cp>
<cp>%EXEDIR%/lib/pde.jar</cp>
<cp>%EXEDIR%/lib/rsyntaxtextarea-2.6.1.jar</cp>
<cp>%EXEDIR%/lib/rsyntaxtextarea-3.0.3-SNAPSHOT.jar</cp>
<cp>%EXEDIR%/lib/xml-apis-1.3.04.jar</cp>
<cp>%EXEDIR%/lib/xml-apis-ext-1.3.04.jar</cp>
<cp>%EXEDIR%/lib/xmlgraphics-commons-2.0.jar</cp>

View File

@ -50,7 +50,7 @@
<cp>%EXEDIR%/lib/jsch-0.1.50.jar</cp>
<cp>%EXEDIR%/lib/jssc-2.8.0-arduino2.jar</cp>
<cp>%EXEDIR%/lib/pde.jar</cp>
<cp>%EXEDIR%/lib/rsyntaxtextarea-2.6.1.jar</cp>
<cp>%EXEDIR%/lib/rsyntaxtextarea-3.0.3-SNAPSHOT.jar</cp>
<cp>%EXEDIR%/lib/xml-apis-1.3.04.jar</cp>
<cp>%EXEDIR%/lib/xml-apis-ext-1.3.04.jar</cp>
<cp>%EXEDIR%/lib/xmlgraphics-commons-2.0.jar</cp>