From 942c074056eb0f68fa0ece8f37e37ed1ba0f17b5 Mon Sep 17 00:00:00 2001 From: hneemann Date: Fri, 2 Mar 2018 08:29:25 +0100 Subject: [PATCH] added proper GPL notice to some files --- .../core/arithmetic/BarrelShifter.java | 7 ++-- .../core/arithmetic/BarrelShifterMode.java | 7 +++- .../core/arithmetic/LeftRightFormat.java | 7 +++- .../gui/components/SingleValueDialog.java | 8 +++-- .../de/neemann/digital/lang/TestLang.java | 32 ++++++++++++++++--- 5 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src/main/java/de/neemann/digital/core/arithmetic/BarrelShifter.java b/src/main/java/de/neemann/digital/core/arithmetic/BarrelShifter.java index 57034b444..f138f7f19 100644 --- a/src/main/java/de/neemann/digital/core/arithmetic/BarrelShifter.java +++ b/src/main/java/de/neemann/digital/core/arithmetic/BarrelShifter.java @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2016 Helmut Neemann, Rüdiger Heintz + * Use of this source code is governed by the GPL v3 license + * that can be found in the LICENSE file. + */ package de.neemann.digital.core.arithmetic; import de.neemann.digital.core.*; @@ -10,8 +15,6 @@ import static de.neemann.digital.core.element.PinInfo.input; /** * A barrel shifter - * - * @author heintz */ public class BarrelShifter extends Node implements Element { diff --git a/src/main/java/de/neemann/digital/core/arithmetic/BarrelShifterMode.java b/src/main/java/de/neemann/digital/core/arithmetic/BarrelShifterMode.java index 75b8fd2e1..cfb268eb9 100644 --- a/src/main/java/de/neemann/digital/core/arithmetic/BarrelShifterMode.java +++ b/src/main/java/de/neemann/digital/core/arithmetic/BarrelShifterMode.java @@ -1,7 +1,12 @@ +/* + * Copyright (c) 2016 Helmut Neemann, Rüdiger Heintz + * Use of this source code is governed by the GPL v3 license + * that can be found in the LICENSE file. + */ package de.neemann.digital.core.arithmetic; /** - * @author heintz + * the barrel shifter mode */ public enum BarrelShifterMode { /** diff --git a/src/main/java/de/neemann/digital/core/arithmetic/LeftRightFormat.java b/src/main/java/de/neemann/digital/core/arithmetic/LeftRightFormat.java index 534db8eda..6e6f7024f 100644 --- a/src/main/java/de/neemann/digital/core/arithmetic/LeftRightFormat.java +++ b/src/main/java/de/neemann/digital/core/arithmetic/LeftRightFormat.java @@ -1,10 +1,15 @@ +/* + * Copyright (c) 2016 Helmut Neemann, Rüdiger Heintz + * Use of this source code is governed by the GPL v3 license + * that can be found in the LICENSE file. + */ package de.neemann.digital.core.arithmetic; import de.neemann.digital.core.ObservableValue; /** - * @author heintz + * the barrel shifter direction */ public enum LeftRightFormat { /** diff --git a/src/main/java/de/neemann/digital/gui/components/SingleValueDialog.java b/src/main/java/de/neemann/digital/gui/components/SingleValueDialog.java index 9a287d059..7bfaf9a48 100644 --- a/src/main/java/de/neemann/digital/gui/components/SingleValueDialog.java +++ b/src/main/java/de/neemann/digital/gui/components/SingleValueDialog.java @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2016 Helmut Neemann, Rüdiger Heintz + * Use of this source code is governed by the GPL v3 license + * that can be found in the LICENSE file. + */ package de.neemann.digital.gui.components; import de.neemann.digital.core.*; @@ -19,9 +24,6 @@ import java.util.Arrays; /** * Dialog to edit a single value. * Used to enter a multi bit input value. - * - * @author hneemann - * @author Rüdiger Heintz */ public final class SingleValueDialog extends JDialog implements ModelStateObserverTyped { diff --git a/src/test/java/de/neemann/digital/lang/TestLang.java b/src/test/java/de/neemann/digital/lang/TestLang.java index d353c7b8d..01417b34a 100644 --- a/src/test/java/de/neemann/digital/lang/TestLang.java +++ b/src/test/java/de/neemann/digital/lang/TestLang.java @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2016 Helmut Neemann + * Use of this source code is governed by the GPL v3 license + * that can be found in the LICENSE file. + */ package de.neemann.digital.lang; import de.neemann.digital.integration.Resources; @@ -11,7 +16,6 @@ import java.util.HashSet; import java.util.Map; /** - * Created by hneemann on 20.10.16. */ public class TestLang extends TestCase { private static final String SOURCEPATH = "/home/hneemann/Dokumente/Java/digital/src/main/java"; @@ -52,7 +56,7 @@ public class TestLang extends TestCase { HashSet keys = new HashSet<>(); parseTree(new File(sources), keys); // check also test code. Is needed because documentation generation uses language key also. - parseTree(new File(Resources.getRoot(),"../java"), keys); + parseTree(new File(Resources.getRoot(), "../java"), keys); StringBuilder sb = new StringBuilder(); for (String key : map.keySet()) { @@ -64,8 +68,8 @@ public class TestLang extends TestCase { } } } - if (sb.length()>0) - fail("there are unused language keys: "+sb.toString()); + if (sb.length() > 0) + fail("there are unused language keys: " + sb.toString()); } private void parseTree(File file, HashSet keys) throws IOException { @@ -85,6 +89,8 @@ public class TestLang extends TestCase { } private void checkSourceFile(File f, HashSet keys) throws IOException { + int state = 0; + try (BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(f), "utf-8"))) { int linecount = 0; String line; @@ -95,8 +101,26 @@ public class TestLang extends TestCase { } catch (AssertionFailedError e) { throw new AssertionFailedError(e.getMessage() + " in line " + linecount); } + + switch (state) { + case 0: + if (line.trim().equals("* Use of this source code is governed by the GPL v3 license")) + state = 1; + break; + case 1: + if (line.trim().equals("* that can be found in the LICENSE file.")) + state = 2; + else + state = 0; + break; + } } } + if (state != 2) + throw new IOException("found file without proper license notice: " + f+ "\n\n" + +"Every java file must contain the lines\n\n" + +"* Use of this source code is governed by the GPL v3 license\n" + +"* that can be found in the LICENSE file."); } private static final String PATTERN = "Lang.get(\"";