[JIRA] Created: (LBCORE-229) Compiler error (I have the compiler set to "sensitive") because of missing enum case in switch statement in PropertySetter.computeAggregationType()

Compiler error (I have the compiler set to "sensitive") because of missing enum case in switch statement in PropertySetter.computeAggregationType() --------------------------------------------------------------------------------------------------------------------------------------------------- Key: LBCORE-229 URL: http://jira.qos.ch/browse/LBCORE-229 Project: logback-core Issue Type: Bug Affects Versions: 0.9.30 Reporter: David Tonhofer Assignee: Logback dev list Priority: Minor In PropertySetter.computeAggregationType(), the switch statement should be completed: if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; } } to something like this (unsure whether logic correct, which is why switch statements should be completed, right?): if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; case AS_BASIC_PROPERTY_COLLECTION: // FALL-THROUGH case AS_COMPLEX_PROPERTY_COLLECTION: throw new IllegalStateException(""Can't happen: " + type); break; } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-229?page=com.atlassian.jira.plugin.system.i... ] David Tonhofer commented on LBCORE-229: --------------------------------------- Same problem in: ch.qos.logback.core.joran.action.NestedBasicPropertyIA.body() ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end() ch.qos.logback.core.db.dialect.DBUtil.getDialectFromCode()
Compiler error (I have the compiler set to "sensitive") because of missing enum case in switch statement in PropertySetter.computeAggregationType() ---------------------------------------------------------------------------------------------------------------------------------------------------
Key: LBCORE-229 URL: http://jira.qos.ch/browse/LBCORE-229 Project: logback-core Issue Type: Bug Affects Versions: 0.9.30 Reporter: David Tonhofer Assignee: Logback dev list Priority: Minor
In PropertySetter.computeAggregationType(), the switch statement should be completed: if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; } } to something like this (unsure whether logic correct, which is why switch statements should be completed, right?): if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; case AS_BASIC_PROPERTY_COLLECTION: // FALL-THROUGH case AS_COMPLEX_PROPERTY_COLLECTION: throw new IllegalStateException(""Can't happen: " + type); break; } }
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-229?page=com.atlassian.jira.plugin.system.i... ] Ceki Gulcu commented on LBCORE-229: ----------------------------------- Which IDE are you using?
Compiler error (I have the compiler set to "sensitive") because of missing enum case in switch statement in PropertySetter.computeAggregationType() ---------------------------------------------------------------------------------------------------------------------------------------------------
Key: LBCORE-229 URL: http://jira.qos.ch/browse/LBCORE-229 Project: logback-core Issue Type: Bug Affects Versions: 0.9.30 Reporter: David Tonhofer Assignee: Logback dev list Priority: Minor
In PropertySetter.computeAggregationType(), the switch statement should be completed: if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; } } to something like this (unsure whether logic correct, which is why switch statements should be completed, right?): if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; case AS_BASIC_PROPERTY_COLLECTION: // FALL-THROUGH case AS_COMPLEX_PROPERTY_COLLECTION: throw new IllegalStateException(""Can't happen: " + type); break; } }
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-229?page=com.atlassian.jira.plugin.system.i... ] David Tonhofer commented on LBCORE-229: --------------------------------------- Hi Ceki, Yes, Eclipse, with Prefernces->Java->Compiler->Errors/Warnings->Potential programming problems->Enum type constant not covered in switch := 'ERROR'
Compiler error (I have the compiler set to "sensitive") because of missing enum case in switch statement in PropertySetter.computeAggregationType() ---------------------------------------------------------------------------------------------------------------------------------------------------
Key: LBCORE-229 URL: http://jira.qos.ch/browse/LBCORE-229 Project: logback-core Issue Type: Bug Affects Versions: 0.9.30 Reporter: David Tonhofer Assignee: Logback dev list Priority: Minor
In PropertySetter.computeAggregationType(), the switch statement should be completed: if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; } } to something like this (unsure whether logic correct, which is why switch statements should be completed, right?): if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; case AS_BASIC_PROPERTY_COLLECTION: // FALL-THROUGH case AS_COMPLEX_PROPERTY_COLLECTION: throw new IllegalStateException(""Can't happen: " + type); break; } }
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
participants (2)
-
Ceki Gulcu (JIRA)
-
David Tonhofer (JIRA)