Mariusz Sieroń 6 年 前
コミット
4b7c13a383

+ 0 - 43
assira.drafts/src/main/java/net/ranides/assira/lambda/NewClass1.java

@@ -1,43 +0,0 @@
-/*
- * @author Ranides Atterwim <ranides@gmail.com>
- * @copyright Ranides Atterwim
- * @license WTFPL
- * @url http://ranides.net/projects/assira.drafts
- */
-package net.ranides.assira.lambda;
-
-import java.util.function.Function;
-import net.ranides.assira.functional.EachFunction;
-import net.ranides.assira.xml.XMLElement;
-
-/**
- *
- * @author Ranides Atterwim <ranides@gmail.com>
- */
-public class NewClass1<U> {
-    
-    public <A> void map(Function<U,A> action) {
-        // do nothing
-    }
-    
-    public <A> void map(EachFunction<U,A> action) {
-        // do nothing
-    }
-    
-    public static void main(String[] args) {
-        NewClass1<XMLElement> z = new NewClass1<>();
-        
-        z.map(item -> "111");
-        z.map((index, item) -> index+"."+item);
-        z.map(e -> e.attrs());
-        z.map(e -> e.text());
-        z.map(e -> e.text("q"));
-        
-        z.map(Object::toString);
-        z.map(XMLElement::attrs);
-        z.map(XMLElement::name);
-        
-//        z.map(XMLElement::text);
-        
-    }
-}

+ 62 - 0
assira.drafts/src/main/java/net/ranides/assira/prototype/ActiveEvent.java

@@ -0,0 +1,62 @@
+package net.ranides.assira.prototype;
+
+import net.ranides.assira.events.Event;
+
+public abstract class ActiveEvent implements Event {
+
+    private final ActiveObject source;
+
+    private final String property;
+
+    private final Object value;
+
+    public ActiveEvent(ActiveObject source, String property, Object value) {
+        this.source = source;
+        this.property = property;
+        this.value = value;
+    }
+
+    public ActiveObject source() {
+        return source;
+    }
+
+    public String property() {
+        return property;
+    }
+
+    public Object value() {
+        return value;
+    }
+
+    class Create extends ActiveEvent {
+
+        public Create(ActiveObject source, String property, Object value) {
+            super(source, property, value);
+        }
+
+    }
+
+    class Update extends ActiveEvent {
+
+        private final Object previous;
+
+        public Update(ActiveObject source, String property, Object previous, Object value) {
+            super(source, property, value);
+            this.previous = previous;
+        }
+
+        public Object previous() {
+            return previous;
+        }
+
+    }
+
+    class Delete extends ActiveEvent {
+
+        public Delete(ActiveObject source, String property, Object value) {
+            super(source, property, value);
+        }
+
+    }
+
+}

+ 6 - 0
assira.drafts/src/main/java/net/ranides/assira/prototype/ActiveObject.java

@@ -0,0 +1,6 @@
+package net.ranides.assira.prototype;
+
+import net.ranides.assira.events.EventRouter;
+
+public interface ActiveObject extends LightObject, EventRouter {
+}

+ 4 - 0
assira.drafts/src/main/java/net/ranides/assira/prototype/LightInterface.java

@@ -0,0 +1,4 @@
+package net.ranides.assira.prototype;
+
+public class LightInterface {
+}

+ 4 - 0
assira.drafts/src/main/java/net/ranides/assira/prototype/LightObject.java

@@ -0,0 +1,4 @@
+package net.ranides.assira.prototype;
+
+public interface LightObject {
+}

+ 0 - 20
assira.drafts/src/main/java/net/ranides/assira/reflection/RuntimeUtils.java

@@ -1,20 +0,0 @@
-/*
- * @author Ranides Atterwim <ranides@gmail.com>
- * @copyright Ranides Atterwim
- * @license WTFPL
- * @url http://ranides.net/projects/assira
- */
-package net.ranides.assira.reflection;
-
-
-/**
- *
- * @author Ranides Atterwim <ranides@gmail.com>
- */
-public final class RuntimeUtils {
-
-    public static boolean disableJDK9Warning() {
-        return SunUtils.putObjectVolatile("jdk.internal.module.IllegalAccessLogger", "logger", null);
-    }
-
-}

+ 1 - 5
assira.junit/src/main/java/net/ranides/assira/junit/TestUtils.java

@@ -24,11 +24,7 @@ import java.util.regex.Pattern;
 @SuppressWarnings("PMD.MethodNameRules")
 final class TestUtils {
     
-    // @todo (assira.junit) wywalić type inference Function na podst constant pool
-    // nie mamy 100% gwarancji, że rozpozna dobrze
-    // a w frameworku do unit testów to oznacza, że MUSI wylecieć
-
-	private TestUtils() { 
+	private TestUtils() {
 		/* utility class */
 	}
 

+ 5 - 0
assira.lambda/src/main/java/net/ranides/assira/reflection/UnsafeUtils.java

@@ -1,5 +1,7 @@
 package net.ranides.assira.reflection;
 
+import net.ranides.assira.annotations.Meta;
+
 import java.lang.reflect.Field;
 import java.security.ProtectionDomain;
 
@@ -17,14 +19,17 @@ public class UnsafeUtils {
         }
     }
 
+    @Meta.UnstableAPI
     public static UnsafeAdapter getUnsafe() throws ReflectiveOperationException {
         return getUnsafe0(UnsafeAdapter.class);
     }
 
+    @Meta.UnstableAPI
     public static UnsafeAdapter8 getUnsafe8() throws ReflectiveOperationException {
         return getUnsafe0(UnsafeAdapter8.class);
     }
 
+    @Meta.UnstableAPI
     public static UnsafeAdapter9 getUnsafe9() throws ReflectiveOperationException {
         return getUnsafe0(UnsafeAdapter9.class);
     }

+ 4 - 2
assira.lambda/src/main/java/net/ranides/assira/reflection/impl/CPInspector.java

@@ -24,9 +24,11 @@ import java.util.stream.StreamSupport;
  */
 public final class CPInspector {
 
-    // todo (assira.lambda #1) compatibility
+    // @todo (assira.lambda #1) ConstantPool wrapper identical to UnsafeUtils
+    // wrapper should use compatibility constructs from link below to construct correct wrapper for corresponding JDK
     // https://github.com/jhalterman/typetools/pull/49/files
-    
+
+
     private CPInspector() {
         /* utility class */
     }

+ 1 - 1
assira.rules.test/src/main/java/net/ranides/assira/rules/test/CustomRules1.java

@@ -19,7 +19,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 @SuppressFBWarnings
 public class CustomRules1 { // Expected: TEST-UF
     
-    // @todo (assira.rules) support for @Test and @TestContract
+    // @todo (assira.rules #1) support for @Test and @TestContract
     
     // Niech reguły do junit wykrywają metody adnotowane za pomocą:
     // @Test 

+ 0 - 28
assira/src/main/java/net/ranides/assira/credentials/BasicUserStore.java

@@ -44,30 +44,6 @@ public class BasicUserStore implements UserStore {
                 .optional().eq(UserProperty.PORT, uri.getPort())
                 .filter(u -> urimatch(u, uri));
         }
-
-
-
-//        Set<GenericMap<String>> target = new HashSet<>();
-//
-//        IQuery<GenericMap<String>> query = tree.find()
-//            .optional().eq(UserProperty.HOST, uri.getHost())
-//            .optional().eq(UserProperty.PORT, uri.getPort());
-//
-//        Optional<String> login = URIUtils.getLogin(uri);
-//
-//        if(login.isPresent()) {
-//            query.eq(UserProperty.ACCOUNT, login.get()).into(target);
-//            query.eq(UserProperty.LOGIN, login.get()).into(target);
-//            query.filter(u -> urimatch(u, uri))
-//        } else {
-//            tree.find()
-//                .eq(UserProperty.HOST, null)
-//                .eq(UserProperty.PORT, null)
-//                .filter(u -> urimatch(u, uri))
-//                .into(target);
-//        }
-//
-//        return CQueryBuilder.fromStream(() -> target.stream());
     }
 
     private boolean urimatch(GenericMap<String> u, URI uri) {
@@ -84,8 +60,4 @@ public class BasicUserStore implements UserStore {
         return this;
     }
 
-//    public BasicUserStore add(GenericMap<String> user) {
-//        tree.put(user);
-//        return this;
-//    }
 }

+ 1 - 1
assira/src/main/java/net/ranides/assira/io/uri/impl/CHTTPHandler.java

@@ -215,7 +215,7 @@ public class CHTTPHandler implements URIHandler {
         return Charset.forName(hit.group(1));
     }
 
-    // todo (assira #3) CHTTPHandler - support for authorization encoding
+    // todo (assira #3) CHTTPHandler - support for authorization encoding / charset
     // https://stackoverflow.com/questions/7242316/what-encoding-should-i-use-for-http-basic-authentication
     private static void setAuthorizationHeader(HttpURLConnection connection, GenericMap<String> user) {
         String passphrase = user.get(UserProperty.LOGIN) + ":" + user.get(UserProperty.PASSWORD);

+ 1 - 1
assira/src/main/java/net/ranides/assira/reflection/asm/AsmMethodBuilder.java

@@ -9,7 +9,7 @@ import static net.ranides.asm.Opcodes.*;
 
 public class AsmMethodBuilder {
 
-     // @todo see ASM GeneratorAdapter https://asm.ow2.io/javadoc/org/objectweb/asm/commons/GeneratorAdapter.html
+     // @todo (assira #8) see ASM GeneratorAdapter https://asm.ow2.io/javadoc/org/objectweb/asm/commons/GeneratorAdapter.html
 
     private final AsmClassBuilder parent;
 

+ 0 - 1
assira1/.gitignore

@@ -1 +0,0 @@
-/target/

+ 0 - 26
assira1/nb-configuration.xml

@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-shared-configuration>
-    <!--
-This file contains additional configuration written by modules in the NetBeans IDE.
-The configuration is intended to be shared among all the users of project and
-therefore it is assumed to be part of version control checkout.
-Without this configuration present, some functionality in the IDE may be limited or fail altogether.
--->
-    <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
-        <!--
-Properties that influence various parts of the IDE, especially code formatting and the like. 
-You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
-That way multiple projects can share the same settings (useful for formatting rules for example).
-Any value defined here will override the pom.xml file value but is only applicable to the current project.
--->
-        <netbeans.compile.on.save>all</netbeans.compile.on.save>
-        <netbeans.hint.jdkPlatform>JDK_1.7</netbeans.hint.jdkPlatform>
-        <org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>none</org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>
-        <org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>4</org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>
-        <org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>4</org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>
-        <org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>4</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>
-        <org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>
-        <org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>
-        <org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
-    </properties>
-</project-shared-configuration>

+ 0 - 23
assira1/stage.bat

@@ -1,23 +0,0 @@
-@echo off
-
-call "%IBS_MAVEN_DIR%\bin\mvn.bat" install
-
-if exist target\stage (
-    rmdir /S /Q target\stage     
-)
-mkdir target\stage
-
-
-echo.[INFO] export "pom.xml"
-copy pom.xml target\stage\assira.xml > nul
-
-echo.[INFO] export "assira.jar"
-copy target\assira-*.jar target\stage > nul
-ren target\stage\assira-*.jar assira.jar
- 
-echo.[INFO] ------------------------------------------------------------------------
-echo.[INFO] STAGE SUCCESS 
-echo.
-
-pause > nul
-:end