[ 
https://issues.apache.org/jira/browse/APEXMALHAR-998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15310019#comment-15310019
 ] 

ASF GitHub Bot commented on APEXMALHAR-998:
-------------------------------------------

GitHub user tushargosavi opened a pull request:

    https://github.com/apache/incubator-apex-malhar/pull/305

    APEXMALHAR-998 extend second type parameter from Object

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tushargosavi/incubator-apex-malhar 
APEXMALHAR-998

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-apex-malhar/pull/305.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #305
    
----
commit e809bee20b0761e32bf4b1213e0dafa2791178de
Author: Tushar R. Gosavi <[email protected]>
Date:   2016-06-01T09:32:27Z

    APEXMALHAR-998 extend second type parameter from Object

----


> Compilation error while using UniqueValueCount operator.
> --------------------------------------------------------
>
>                 Key: APEXMALHAR-998
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-998
>             Project: Apache Apex Malhar
>          Issue Type: Bug
>            Reporter: Tushar Gosavi
>            Assignee: Tushar Gosavi
>
> Got compilation error while using UniqueValueCount operator,
> [ERROR] bootstrap class path not set in conjunction with -source 1.6
> /home/tushar/work/github/Malhar/demos/src/main/java/com/datatorrent/demos/uniquevaluetest/Application.java:[31,11]
>  error: no suitable method found for 
> addStream(String,DefaultOutputPort<KeyValPair<String,Integer>>,DefaultInputPort<KeyValPair<String,Object>>)
> The problem is type  KeyValPair<String, Integer> is different than type 
> <String, Object> used in operator, generic type needs to be extended from 
> Object for typematch.
> The fix is
> --- a/library/src/main/java/com/datatorrent/lib/algo/UniqueValueCount.java
> +++ b/library/src/main/java/com/datatorrent/lib/algo/UniqueValueCount.java
> @@ -46,10 +46,9 @@ public class UniqueValueCount<K> extends BaseOperator {
>  
>  
>      @InputPortFieldAnnotation(name="inputPort")
> -    public transient DefaultInputPort<KeyValPair<K,Object>> inputPort = new 
> DefaultInputPort<KeyValPair<K,Object>>() {
> -
> +    public transient DefaultInputPort<KeyValPair<K,? extends Object>> 
> inputPort = new DefaultInputPort<KeyValPair<K,? extends Object>>() {
>          @Override
> -        public void process(KeyValPair<K, Object> pair) {
> +        public void process(KeyValPair<K, ? extends Object> pair) {
>              Set<Object> values= interimUniqueValues.get(pair.getKey());
>              if(values==null){
>                  values=Sets.newHashSet();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to