Java: Removed bailout added in 120073f000

This commit is contained in:
Daniel Marjamäki 2010-10-28 18:01:51 +02:00
parent 995e39200b
commit fee20bafa0
2 changed files with 23 additions and 5 deletions

View File

@ -745,7 +745,7 @@ void CheckClass::SpaceInfo::getVarList()
} }
// If the vartok was set in the if-blocks above, create a entry for this variable.. // If the vartok was set in the if-blocks above, create a entry for this variable..
if (vartok && vartok->str() != "operator" && !Token::Match(vartok->next(), "; %varid% =", vartok->varId())) if (vartok && vartok->str() != "operator")
{ {
if (vartok->varId() == 0 && check->_settings->debugwarnings) if (vartok->varId() == 0 && check->_settings->debugwarnings)
{ {

View File

@ -2244,12 +2244,30 @@ private:
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }
void checkUninitVarJava(const char code[])
{
// Tokenize..
Tokenizer tokenizer;
std::istringstream istr(code);
tokenizer.tokenize(istr, "test.java");
tokenizer.simplifyTokenList();
// Clear the error log
errout.str("");
// Check..
Settings settings;
settings._checkCodingStyle = true;
CheckClass checkClass(&tokenizer, &settings, this);
checkClass.constructors();
}
void uninitJava() void uninitJava()
{ {
checkUninitVar("class A {\n" checkUninitVarJava("class A {\n"
" private: int i = 0;\n" " private: int i = 0;\n"
" public: A() { }\n" " public: A() { }\n"
"};"); "};");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }