google / google/guice

@Finder annotation issue

Open
#764 0 comments 0 reactions 0 assignees View on GitHub
imported
Dominant language
Java
Stars
12.7k
Forks
1.7k
Avg merge
11m
Merged PRs (30d)
2

Description

_From [vesko.m.georgiev](https://code.google.com/u/107795549052562307055/) on August 19, 2013 09:52:27_

In `@`Finder annotation returnAs() has default value Collection.class. However, if you forget to specify it, it throws an exception because it cannot create an instance of class Collection.class. e.g.

// the following will throw an exception.
`@`Finder(namedQuery = "MyNamedQuery")
List<MyEntity> someQuery(`@`Named("name") String name);

// this is fine
`@`Finder(namedQuery = "MyNamedQuery", returnAs = LinkedList.class)
List<MyEntity> someQuery(`@`Named("name") String name);

returnAs() should either have no default value, to enforce the user to specify it, or have LinkedList.class/ArrayList.class as a default value.

_Original issue: http://code.google.com/p/google-guice/issues/detail?id=764_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.