Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class CSS2PrimitiveValueImpl implements CSSPrimitiveValue {

private int i = -9999;

private short primitiveType;
private final short primitiveType;

public CSS2PrimitiveValueImpl(String s) {
this.s = s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
*/
public class CSS2RGBColorImpl implements RGBColor {

private CSSPrimitiveValue red;
private CSSPrimitiveValue green;
private CSSPrimitiveValue blue;
private final CSSPrimitiveValue red;
private final CSSPrimitiveValue green;
private final CSSPrimitiveValue blue;

public CSS2RGBColorImpl(int r, int g, int b) {
red = new CSS2PrimitiveValueImpl(r);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

public class ArrayNodeList implements NodeList {

private Object[] elements;
private CSSEngine engine;
private final Object[] elements;
private final CSSEngine engine;

public ArrayNodeList(List<?> elements, CSSEngine engine) {
this(elements.toArray(), engine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public abstract class ElementAdapter implements Element, CSSStylableElement {

private static final String[] EMPTY_STRING = new String[0];

private Object nativeWidget;
private final Object nativeWidget;

protected CSSEngine engine;

private Map <String, CSSStyleDeclaration> defaultStyleDeclarationMap = new HashMap<>();
private final Map <String, CSSStyleDeclaration> defaultStyleDeclarationMap = new HashMap<>();

private CSSExtendedProperties style;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class CSSPropertyHandlerLazyProviderImpl extends
AbstractCSSPropertyHandlerProvider {

// List of package names containing handlers class for properties
private List<String> packageNames = new ArrayList<>();
private final List<String> packageNames = new ArrayList<>();

// Map used as a cache for properties handlers found
private Map<String, List<ICSSPropertyHandler>> propertyToHandlersMap = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ public class CSSPropertyHandlerSimpleProviderImpl extends
*/
private static Map<String, Class<? extends ICSSPropertyHandler>> defaultCSSProperties = new HashMap<>();

private Map<Class<?>, List<ICSSPropertyHandler>> propertiesHandler = new HashMap<>();
private final Map<Class<?>, List<ICSSPropertyHandler>> propertiesHandler = new HashMap<>();

/**
* Custom <code>Map</code> of <code>ICSSPropertyHandler</code> stored
* under a CSS property <code>name</code> key.
*/
private Map<String, Class<? extends ICSSPropertyHandler>> customCSSProperties = new HashMap<>();
private final Map<String, Class<? extends ICSSPropertyHandler>> customCSSProperties = new HashMap<>();

/**
* True if custom CSS properties is merged with default CSS Properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
public class CSSComputedStyleImpl extends CSSStyleDeclarationImpl implements CSSStyleDeclaration {

private List<StyleWrapper> styleRules;
private final List<StyleWrapper> styleRules;

public CSSComputedStyleImpl(List<StyleWrapper> styleRules) {
super(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class CSSPropertyImpl implements CSSProperty {
*/
protected static String IMPORTANT_IDENTIFIER = "important";

private String name;
private final String name;
private CSSValue value;
private boolean important;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

public class CSSRuleListImpl implements CSSRuleList {

private List<CSSRule> ruleList;
private final List<CSSRule> ruleList;

public CSSRuleListImpl() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
public class CSSStyleDeclarationImpl extends AbstractCSSNode implements CSSStyleDeclaration {

private boolean readOnly;
private CSSRule parentRule;
private List<CSSProperty> properties = new ArrayList<>();
private final CSSRule parentRule;
private final List<CSSProperty> properties = new ArrayList<>();
private CSSPropertyList cssPropertyListView;

public CSSStyleDeclarationImpl(CSSRule parentRule) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public class CSSStyleRuleImpl extends CSSRuleImpl implements CSSStyleRule, ExtendedCSSRule {

private SelectorList selectors;
private final SelectorList selectors;
private CSSStyleDeclaration styleDeclaration;

public CSSStyleRuleImpl(CSSStyleSheet parentStyleSheet, CSSRule parentRule, SelectorList selectors) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
*/
public class DocumentCSSImpl implements ExtendedDocumentCSS {

private StyleSheetListImpl styleSheetList = new StyleSheetListImpl();
private final StyleSheetListImpl styleSheetList = new StyleSheetListImpl();

/**
* key=selector type, value = CSSStyleDeclaration
*/
private Map<Integer, List<?>> styleDeclarationMap;

private List<StyleSheetChangeListener> styleSheetChangeListeners = new ArrayList<>(1);
private final List<StyleSheetChangeListener> styleSheetChangeListeners = new ArrayList<>(1);

@Override
public StyleSheetList getStyleSheets() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class MediaListImpl implements MediaList {

private List<String> mediaList;
private final List<String> mediaList;

public MediaListImpl(SACMediaList media) {
mediaList = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

public class RGBColorImpl extends CSSValueImpl implements RGBColor {

private CSSPrimitiveValue red;
private CSSPrimitiveValue green;
private CSSPrimitiveValue blue;
private final CSSPrimitiveValue red;
private final CSSPrimitiveValue green;
private final CSSPrimitiveValue blue;

public RGBColorImpl(LexicalUnit lexicalUnit) {
LexicalUnit nextUnit = lexicalUnit.getParameters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ public abstract class AbstractCSSEngine implements CSSEngine {
/**
* w3c {@link DocumentCSS}.
*/
private ExtendedDocumentCSS documentCSS;
private final ExtendedDocumentCSS documentCSS;

/**
* w3c {@link ViewCSS}.
*/
private ViewCSS viewCSS;
private final ViewCSS viewCSS;

/**
* {@link IElementProvider} used to retrieve w3c Element linked to the
Expand All @@ -144,7 +144,7 @@ public abstract class AbstractCSSEngine implements CSSEngine {
*/
protected List<ICSSPropertyHandlerProvider> propertyHandlerProviders = new ArrayList<>();
// for performance hold a map of handlers to singleton list
private Map<ICSSPropertyHandler2, List<ICSSPropertyHandler2>> propertyHandler2InstanceMap = new HashMap<>();
private final Map<ICSSPropertyHandler2, List<ICSSPropertyHandler2>> propertyHandler2InstanceMap = new HashMap<>();

private Map<String, String> currentCSSPropertiesApplied;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class RegistryCSSElementProvider implements IElementProvider {

final private IExtensionRegistry registry;

private Map<Class<?>, IElementProvider> providerCache = Collections
private final Map<Class<?>, IElementProvider> providerCache = Collections
.synchronizedMap(new WeakHashMap<>());

public RegistryCSSElementProvider(IExtensionRegistry registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public class RegistryCSSPropertyHandlerProvider extends AbstractCSSPropertyHandl

private static final String PROPERTY_HANDLERS_EXTPOINT = "org.eclipse.e4.ui.css.core.propertyHandler";

private IExtensionRegistry registry;
private final IExtensionRegistry registry;
private boolean hasDeprecatedProperties = false; // mild optimization for getCSSProperties()

private Map<String, Map<String, ICSSPropertyHandler>> propertyHandlerMap = new HashMap<>();
private final Map<String, Map<String, ICSSPropertyHandler>> propertyHandlerMap = new HashMap<>();
// for performance hold a map of handlers to singleton list
private Map<ICSSPropertyHandler, List<ICSSPropertyHandler>> propertyHandlerInstanceMap = new HashMap<>();
private final Map<ICSSPropertyHandler, List<ICSSPropertyHandler>> propertyHandlerInstanceMap = new HashMap<>();

public RegistryCSSPropertyHandlerProvider(IExtensionRegistry registry) {
this.registry = registry;
Expand Down Expand Up @@ -234,9 +234,9 @@ protected void logError(String message) {
}

private class DeprecatedPropertyHandlerWrapper implements ICSSPropertyHandler {
private ICSSPropertyHandler delegate;
private String message;
private Set<String> logged = new HashSet<>();
private final ICSSPropertyHandler delegate;
private final String message;
private final Set<String> logged = new HashSet<>();

DeprecatedPropertyHandlerWrapper(ICSSPropertyHandler handler, String message) {
delegate = handler;
Expand Down
Loading