Re: Javac scan '.java' file less some '.class' file

Bill Deegan <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAEyG4CEdLADxv8D4Xs2Z16tuN8Wh2bQYBszcL9dtAnC0=Yfp0w@mail.gmail.com>
I beleive this construct is called "anonymous inner class", is that correct?

public class Example_demo{
    public static void pppp() {
        MyInterface<List<String>> obj = null;        obj = new
MyInterface<List<String>>() {
            @Override
            public String getName() {
                return "MyInterface";
            }
            public String value() {
                return "ABC";
            }
        };
    }
}

If so, please change the title of your github issue to "SCons doesn't
properly process anonymous inner class"


On Mon, May 27, 2019 at 7:43 AM 钟文冰 <[email protected]> wrote:

> Javac scan '.java' file less some '.class' file
>
> * Version of SCons  ------------------------------- 3.0.5
>
> * Version of Python ------------------------------- 3.7.0
>
> * Version of JDK ----------------------------------- 1.8.0_144
>
> * Which python distribution if applicable -------- python.org
>
> * How you installed SCons --------  python setup.py install
>
> * What Platform are you on? ---------------------- Windows 7
>
> * How to reproduce your issue?  Please include a small self contained
> reproducer. Likely a SConstruct should do for most issues.
>
> 1 .  less Generic class
>
>
>
> --------------------------------SConstruct---
>
> print([str(cls) for cls in Java('.','.')])
>
> --------------------------------Example_demo.java--
>
> package bag;
>
> import bag.MyInterface;
>
> import java.util.*;
>
>
>
> public class Example_demo{
>
>     public static void pppp() {
>
>         MyInterface<List<String>> obj = null;
>
>         obj = new MyInterface<List<String>>() {
>
>             @Override
>
>             public String getName() {
>
>                 return "MyInterface";
>
>             }
>
>             public String value() {
>
>                 return "ABC";
>
>             }
>
>         };
>
>     }
>
> }
>
> --------------------------------MyInterface.java--
>
> package bag;
>
> interface MyInterface<T> {
>
>     public String getName();
>
> }
>
>
>
> * How you invoke scons (The command line you're using "scons --flags
> some_arguments")
>
> scons
>
>
>
> scons ouput -------------------->
>
> ['bag\\Example_demo.class', 'bag\\MyInterface.class']
>
>
>
> This generates three class files:
>
> ['bag\\Example_demo$1.class', 'bag\\Example_demo.class',
> 'bag\\MyInterface.class']
>
> but scons does not know about the first one, so it is not included in the
> jar.
>
>
> ----------------------------------------------------------------------------------
>
> *I suggest modifying the file scons\SCons\Tool\JavaCommon.py*
>
> *Line 63  “ _reToken =
> re.compile(r'(\n|\\\\|//|\\[\'"]|[\'"\{\}\;\.\(\)]|' +*
>
> *                          r'\d*\.\d*|[A-Za-z_][\w\$\.]*|<[A-Za-z_]\w+>|'
> +*
>
> *                          r'/\*|\*/|\[\])')”*
>
> *to          “ _reToken =
> re.compile(r'(\n|\\\\|//|\\[\'"]|[\'"\{\}\;\.\(\)]|' +*
>
> *
> r'\d*\.\d*|[A-Za-z_][\w\$\.]*|<[A-Za-z_][\w<>]+>|' +*
>
> *                          r'/\*|\*/|\[\])')”*
>
>
>
> 2 .  less Generic class
>
>
>
> --------------------------------SConstruct---
>
> print([str(cls) for cls in Java('.','.')])
>
> --------------------------------FinalCls.java--
>
> public final class FinalCls {
>
>     private static class InnerSubClass extends Object {
>
>         public String toString() {
>
>             return "InnerSubClass of FinalCls";
>
>         }
>
>     }
>
>     public static final Object STATIC_FINAL_OBJ = new InnerSubClass();
>
> }
>
>
>
> * How you invoke scons (The command line you're using "scons --flags
> some_arguments")
>
> scons
>
>
>
> scons ouput -------------------->
>
> ['FinalCls$InnerSubClass.class', 'FinalCls.class']
>
>
>
> This generates three class files:
>
> ['FinalCls$1.class', 'FinalCls$InnerSubClass.class', 'FinalCls.class']
>
> but scons does not know about the first one, so it is not included in the
> jar.
>
>
> -----------------------------------------------------------------------------------
>
> *Lost files(*FinalCls$1.class*) do not seem to affect the execution of
> the program*
>
>
>
> 发送自 Windows 10 版邮件 <https://go.microsoft.com/fwlink/?LinkId=550986>应用
>
>
> _______________________________________________
> Scons-users mailing list
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.