<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.5</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>下载2.6.5的jar包</li>
<li>解压进入META-INF\dubbo\internal目录</li>
<li>基本上所有配置文件全部重复了3次</li>
</ol>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/11451381/49272920-2fe7b000-f4ae-11e8-9209-cb08e4c998db.png"><img src="https://user-images.githubusercontent.com/11451381/49272920-2fe7b000-f4ae-11e8-9209-cb08e4c998db.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.0</li>
<li>Operating System version: centos</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">需求</h3>
<p dir="auto">泛化调用，返回值增加的class字段，建议增加开关。</p>
<h3 dir="auto">举例</h3>
<p dir="auto">在PojoUtils.java中，有两处建议怎么增加该开关，如下：</p>
<ol dir="auto">
<li>put "class" 字段</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
history.put(pojo, map);
map.put(&quot;class&quot;, pojo.getClass().getName());"><pre class="notranslate"><code class="notranslate">Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
history.put(pojo, map);
map.put("class", pojo.getClass().getName());
</code></pre></div>
<ol start="2" dir="auto">
<li>根据条件remove "class" 字段</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// when return type is not the subclass of return type from the signature and not an interface
if (!type.isInterface() &amp;&amp; !type.isAssignableFrom(pojo.getClass())) {
    try {
        map = (Map&lt;Object, Object&gt;) type.newInstance();
        Map&lt;Object, Object&gt; mapPojo = (Map&lt;Object, Object&gt;) pojo;
        map.putAll(mapPojo);
        map.remove(&quot;class&quot;);
    } catch (Exception e) {
        //ignore error
        map = (Map&lt;Object, Object&gt;) pojo;
    }
} else {
    map = (Map&lt;Object, Object&gt;) pojo;
}"><pre class="notranslate"><code class="notranslate">// when return type is not the subclass of return type from the signature and not an interface
if (!type.isInterface() &amp;&amp; !type.isAssignableFrom(pojo.getClass())) {
    try {
        map = (Map&lt;Object, Object&gt;) type.newInstance();
        Map&lt;Object, Object&gt; mapPojo = (Map&lt;Object, Object&gt;) pojo;
        map.putAll(mapPojo);
        map.remove("class");
    } catch (Exception e) {
        //ignore error
        map = (Map&lt;Object, Object&gt;) pojo;
    }
} else {
    map = (Map&lt;Object, Object&gt;) pojo;
}
</code></pre></div>
<p dir="auto">期待修改成以下代码：</p>
<ol dir="auto">
<li>put "class" 字段</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
history.put(pojo, map);
if (keepGenericClass){  // to increase the switch for control generics
    map.put(&quot;class&quot;, pojo.getClass().getName());
}"><pre class="notranslate"><code class="notranslate">Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
history.put(pojo, map);
if (keepGenericClass){  // to increase the switch for control generics
    map.put("class", pojo.getClass().getName());
}
</code></pre></div>
<ol start="2" dir="auto">
<li>根据条件remove "class" 字段</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// when return type is not the subclass of return type from the signature and not an interface
if (!type.isInterface() &amp;&amp; !type.isAssignableFrom(pojo.getClass())) {
    try {
        map = (Map&lt;Object, Object&gt;) type.newInstance();
        Map&lt;Object, Object&gt; mapPojo = (Map&lt;Object, Object&gt;) pojo;
        map.putAll(mapPojo);
            if (keepGenericClass){  // to increase the switch for control generics
                map.remove(&quot;class&quot;);
            }
    } catch (Exception e) {
        //ignore error
        map = (Map&lt;Object, Object&gt;) pojo;
    }
} else {
    map = (Map&lt;Object, Object&gt;) pojo;
}"><pre class="notranslate"><code class="notranslate">// when return type is not the subclass of return type from the signature and not an interface
if (!type.isInterface() &amp;&amp; !type.isAssignableFrom(pojo.getClass())) {
    try {
        map = (Map&lt;Object, Object&gt;) type.newInstance();
        Map&lt;Object, Object&gt; mapPojo = (Map&lt;Object, Object&gt;) pojo;
        map.putAll(mapPojo);
            if (keepGenericClass){  // to increase the switch for control generics
                map.remove("class");
            }
    } catch (Exception e) {
        //ignore error
        map = (Map&lt;Object, Object&gt;) pojo;
    }
} else {
    map = (Map&lt;Object, Object&gt;) pojo;
}
</code></pre></div>