Примеры ошибок, обнаруженных с помощью диагностики V6067
V6067. Two or more case-branches perform the same actions.
Apache Dubbo
V6067 Two or more case-branches perform the same actions. JVMUtil.java(67), JVMUtil.java(71)
private static String getThreadDumpString(ThreadInfo threadInfo) {
....
if (i == 0 && threadInfo.getLockInfo() != null) {
Thread.State ts = threadInfo.getThreadState();
switch (ts) {
case BLOCKED:
sb.append("\t- blocked on " + threadInfo.getLockInfo());
sb.append('\n');
break;
case WAITING: // <=
sb.append("\t- waiting on " + threadInfo.getLockInfo());
sb.append('\n');
break;
case TIMED_WAITING: // <=
sb.append("\t- waiting on " + threadInfo.getLockInfo());
sb.append('\n');
break;
default:
}
}
....
}
Apache Hadoop
V6067 Two or more case-branches perform the same actions. TimelineEntityV2Converter.java(386), TimelineEntityV2Converter.java(389)
public static ApplicationReport
convertToApplicationReport(TimelineEntity entity)
{
....
Set<TimelineMetric> metrics = entity.getMetrics();
if (metrics != null) {
long vcoreSeconds = 0;
long memorySeconds = 0;
long preemptedVcoreSeconds = 0;
long preemptedMemorySeconds = 0;
for (TimelineMetric metric : metrics) {
switch (metric.getId()) {
case ApplicationMetricsConstants.APP_CPU_METRICS:
vcoreSeconds = getAverageValue(metric.getValues().values());
break;
case ApplicationMetricsConstants.APP_MEM_METRICS:
memorySeconds = getAverageValue(metric.getValues().values());
break;
case ApplicationMetricsConstants.APP_MEM_PREEMPT_METRICS:
preemptedVcoreSeconds = getAverageValue(metric.getValues().values());
break;
case ApplicationMetricsConstants.APP_CPU_PREEMPT_METRICS:
preemptedVcoreSeconds = getAverageValue(metric.getValues().values());
break;
default:
// Should not happen..
break;
}
}
....
}
....
}
GeoGebra
V6067 Two or more case-branches perform the same actions. PointNDFold.java(38), PointNDFold.java(43)
private static GeoElement doGetTemplate(
Construction cons,
GeoClass listElement
) {
switch (listElement) {
case POINT:
return new GeoPoint(cons);
case POINT3D:
return (GeoElement) cons.getKernel().getGeoFactory().newPoint(3, cons);
case VECTOR:
return new GeoVector(cons);
case VECTOR3D:
return (GeoElement) cons.getKernel().getGeoFactory().newPoint(3, cons);
}
return new GeoPoint(cons);
}
GeoGebra
V6067 Two or more case-branches perform the same actions. RendererImplShadersD.java(243), RendererImplShadersD.java(245)
@Override
protected int getGLType(Type type) {
switch (type) {
case TRIANGLE_STRIP:
return GL.GL_TRIANGLE_STRIP;
case TRIANGLE_FAN:
return GL.GL_TRIANGLE_STRIP; // <=
case TRIANGLES:
return GL.GL_TRIANGLES;
case LINE_LOOP:
return GL.GL_LINE_LOOP;
case LINE_STRIP:
return GL.GL_LINE_STRIP;
}
return 0;
}
Most likely, GL.GL_TRIANGLE_FAN was intended
GeoGebra
V6067 Two or more case-branches perform the same actions. DrawConic3D.java(212), DrawConic3D.java(215)
@Override
protected boolean updateForItSelf() {
....
if (conic.getType() == GeoConicNDConstants.CONIC_SINGLE_POINT) {
....
} else {
if (visible != Visible.FRUSTUM_INSIDE) { // no outline when frustum
....
switch (conic.getType()) {
case GeoConicNDConstants.CONIC_CIRCLE:
updateEllipse(brush); // <=
break;
case GeoConicNDConstants.CONIC_ELLIPSE:
updateEllipse(brush); // <=
break;
case GeoConicNDConstants.CONIC_HYPERBOLA:
updateHyperbola(brush);
break;
case GeoConicNDConstants.CONIC_PARABOLA:
updateParabola(brush);
break;
case GeoConicNDConstants.CONIC_DOUBLE_LINE:
createTmpCoordsIfNeeded();
brush.segment(tmpCoords1.setAdd3(m, tmpCoords1.setMul3(d, minmax[0])),
tmpCoords2.setAdd3(m, tmpCoords2.setMul3(d, minmax[1])));
break;
case GeoConicNDConstants.CONIC_INTERSECTING_LINES:
case GeoConicNDConstants.CONIC_PARALLEL_LINES:
updateLines(brush);
break;
default:
break;
}
}
}
}
The class has updateCircle method which most likely was intended to be utilized here