Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In HtmlElementUtils.newInstance added optional parameter "outerObject". #136

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

Kin-k
Copy link

@Kin-k Kin-k commented Nov 27, 2016

Без этого возникает проблема с вложенными inner-классами HtmlElement-ов.

outerClass.newInstance() - создаёт новый объект outer-класса, для которого запускается популейт, который опять выполняет newInstance для поля, являющегося объектом класса inner-класса.
В котором опять outerClass.newInstance(). В результате вечная рекурсия.

ham1 and others added 20 commits June 6, 2016 11:47
…ement

TypifiedElement implement WebElement
Also a few formatting and wording tweaks.
…-issue-in-table

Fix performance issue in table
@Kin-k Kin-k changed the title HtmlElementUtils: remove final In HtmlElementUtils.newInstance added optional parameter "outerObject". Nov 27, 2016
if (clazz.isMemberClass() && !Modifier.isStatic(clazz.getModifiers())) {
Class outerClass = clazz.getDeclaringClass();
Object outerObject = outerClass.newInstance();
public static <T> T newInstance(Object outerObject, Class<T> clazz, Object... args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Refactor this method to throw at most one checked exception instead of: java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException rule

if (isHtmlElement(field))
return decorateHtmlElement(loader, outerObject, field);
}
catch (ClassCastException ignore) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Either remove or fill this block of code. rule
CRITICAL Either log or rethrow this exception. rule

@qatools-ci
Copy link
Member

SonarQube analysis reported 3 issues:

  • CRITICAL 1 critical
  • MAJOR 2 major

Watch the comments in this conversation to review them.

@eroshenkoam eroshenkoam force-pushed the master branch 2 times, most recently from 58b45bf to 1c8583b Compare March 12, 2018 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants