Giter Site home page Giter Site logo

di-ooad-22fall's Introduction

Hello, I'm YeeTone WANG, a software code farmer

YeeTone Wang will be a PhD student at the Department of Computer Science in ANU, whose supervisor is Prof. Xiaoyu SUN. He is a member of [iSparkLab]. His research is mainly focus on Software Engineering and Automated Testing.

yeetone

Languages and Tools:

c cplusplus csharp java opencv postgresql python

yeetone

 yeetone

yeetone

Research Area:

  • WebAssembly
  • Software Automated Testing
  • JVM and its Implementation
  • Web Browsers

di-ooad-22fall's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

u-officiai

di-ooad-22fall's Issues

关于@Value中的括号的问题

原则上,对于数组或集合类型,序列化的字符串一定带有括号(DI作业文档里也带了),相反,如果带了括号,那一定代表着数组或集合。
在这个前提下,显然合法的注入:

@Value(value= "[1,2,3]")
int[] value_set;

@Value(value= "1,2,3")
int single_value;

但是,在本次DI作业中,以下注入的结果如何呢?

@Value(value= "1,2,3")
int[] value_set;

对于以上代码,我的理解:由于三个元素均为int,而没有int[],因此没有合法输入,最终value_set为null。

@Value(value= "[1,2,3]")
int single_value;

对于以上代码,我的理解:只有一个元素int[],没有int,因此没有合法输入,最终single_value为默认值0。

顺便,虽然official test应该不考,但是也可以考虑的混合情况:

@Value(value= "[1,2,3],4")
int single_value;

对于以上代码,我的理解:第一个元素为int[], 第二个元素为int, single_value的值应该为4.

不知道这样的理解是否正确呐。

Empty String

Hi, test designer, could you please help me with the answers to the following question?

Example is as follows.

public class Example {
    @value(value = "")
    private String string;
    
    @value(value = "[, ,]")
    private List<String> list;
    
    @value(value = "{1:}")
    private Map<Integer, String> map;
}

After injected, what is the result?

关于构造函数参数

If @value is marked on parameters in constructor, when execute the constructor, an specific value should be given to corresponding parameters. We ensure that, in our test cases, all parameters in the constructor that annotated by @Inject are either injected or annotated by @value. If the value() String appears in the value.properties, then first replace it as defined in the properties file; Otherwise, use itself as value().

但是@Inject好像没法作用于parameter

是否可以支持kotlin

kotlin是jvm家族的一员,和Java互操作性较好,且有更现代的性质,不知道OJ是否支持呢?

关于@Value类型不匹配的问题

假设这样一种情况:

@Value(value = "[1,2]")
int a;

@Value(value = "[a,1]")
String b;

此时:

  • a应该用默认值还是1?
  • b是空字符串还是"a"还是"[a"

导致编译错误的异常签名

有部分同学由于IDEA的智能提示功能,修改了BeanFactory接口,增加了可检查异常的方法异常签名,例如:

public interface BeanFactory {
    void loadInjectProperties(File file);
    void loadValueProperties(File file);
    <T> T createInstance(Class<T> clazz) throws ClassNotFoundException, InvocationTargetException;
}

并且将BeanFactoryImpl中也增加了相应的异常签名,如:

public class BeanFactoryImpl implements BeanFactory {
    @Override
    public void loadInjectProperties(File file) {
        // ...
    }
    @Override
    public void loadValueProperties(File file) {
        // ...
    }
    @Override
    public <T> T createInstance(Class<T> clazz) throws ClassNotFoundException, InvocationTargetException {
        // ...
        // Some codes may throw ClassNotFoundException, InvocationTargetException
        return ...;
    }
}

由于official test中并无此种异常抛出的try-catch处理,提交此种类型的代码会导致CE,原因为可检查异常未被try-catch处理。请各位同学务必注意此问题!

d.val 是什么意思

在文档中似乎没找到。

public class D {
    @Value("d.val")
    private int val;

    public int getVal() {
        return val;
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.