Ignore:
Timestamp:
06/24/13 13:38:40 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • upgrade to Java 7
    • use try-multi-catch clauses
    • use try-with-resources were appropriate
  • configure FindBugs? (use mvn site and then navigate in browser to the report)
    • remove most bugs found
  • parametrize Dispatching environment (Dispatcher, RunAt?) to enforce more control on the place of closures actual call

CHANGELOG:
Rework FavouritesXMLFactory.

FindBugs?. Thread start.

FindBugs?. Minor change.

FindBugs?. Iterate over entrySet.

FindBugs?. Various.

FindBug?.

FindBug?. Encoding.

FindBug?. Final fields.

FindBug?.

Remove synchronization bug in ClientConnection?.

Experiments with findbugs.

Finish parametrization.

Make RunAt? an abstract class.

More changes in parametrization.

More changes in parametrizing dispatching.

Several changes to parametrize tasks.

Rename Runnable to RunAt?.

Add specific framsticks Runnable.

Add JSR305 (annotations).

Add findbugs reporting.

More improvements to ParamBuilder? wording.

Make FramsClass? accept also ParamBuilder?.

Change wording of ParamBuilder?.

Change wording of Request creation.

Use Java 7 exception catch syntax.

Add ScopeEnd? class.

Upgrade to Java 7.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/parsers/Schema.java

    r84 r85  
    2626 * classes definitions that can be used in f0 representation). Definitions are
    2727 * loaded from XML stream.
    28  * 
     28 *
    2929 * @author Jarek Szymczak <name.surname@gmail.com>
    3030 * (please replace name and surname with my personal data)
     
    4646        /**
    4747         * Instantiates a new schema.
    48          * 
     48         *
    4949         * @param inputStream
    5050         *            the xml stream with schema
     
    104104                        }
    105105
    106                 } catch (IOException e) {
    107                         logger.fatal("unexpected exception occurred: ", e);
    108                         throw e;
    109                 } catch (ParserConfigurationException e) {
    110                         logger.fatal("unexpected exception occurred: ", e);
    111                         throw e;
    112                 } catch (SAXException e) {
     106                } catch (IOException | ParserConfigurationException | SAXException e) {
    113107                        logger.fatal("unexpected exception occurred: ", e);
    114108                        throw e;
     
    121115         * node under certain attribute getName. If value is not present or is other
    122116         * getType than integer 0 is returned.
    123          * 
     117         *
    124118         * @return attribute value if value exists and it's integer (0 otherwise)
    125          * 
     119         *
    126120         */
    127121        private static int getIntAttribute(NamedNodeMap attributes, String name) {
     
    152146         * Method used for convenience, it retrieves the value stored in node under
    153147         * certain attribute getName. If value is not present method returns null.
    154          * 
     148         *
    155149         * @param attributeName
    156150         *            the attribute getName
     
    158152         *            the node
    159153         * @return attribute value if value exists (null otherwise)
    160          * 
     154         *
    161155         */
    162156        private static String getAttributeFromNode(String attributeName, Node node) {
     
    169163        /**
    170164         * In this method analysis of single class is performed.
    171          * 
     165         *
    172166         * @param classNode
    173167         *            the class node
     
    228222        /**
    229223         * It analyses the single property within the class
    230          * 
     224         *
    231225         * @param attributes
    232226         *            the attributes of property
     
    267261                }
    268262
    269                 ParamBuilder builder = new ParamBuilder();
    270                 builder.setId(id).setName(name).setHelp(description).setGroup(group).setFlags(flags);
    271 
    272                 builder.setType(type);
     263                ParamBuilder builder = Param.build();
     264                builder.id(id).name(name).help(description).group(group).flags(flags);
     265
     266                builder.type(type);
    273267
    274268                if ("d".equals(type)) {
    275                         builder.setMin(extractAttribute(attributes, "MIN", Integer.class));
    276                         builder.setMax(extractAttribute(attributes, "MAX", Integer.class));
    277                         builder.setDef(extractAttribute(attributes, "DEF", Integer.class));
     269                        builder.min(extractAttribute(attributes, "MIN", Integer.class));
     270                        builder.max(extractAttribute(attributes, "MAX", Integer.class));
     271                        builder.def(extractAttribute(attributes, "DEF", Integer.class));
    278272                } else if ("f".equals(type)) {
    279                         builder.setMin(extractAttribute(attributes, "MIN", Double.class));
    280                         builder.setMax(extractAttribute(attributes, "MAX", Double.class));
    281                         builder.setDef(extractAttribute(attributes, "DEF", Double.class));
     273                        builder.min(extractAttribute(attributes, "MIN", Double.class));
     274                        builder.max(extractAttribute(attributes, "MAX", Double.class));
     275                        builder.def(extractAttribute(attributes, "DEF", Double.class));
    282276                } else if ("s".equals(type)) {
    283                         builder.setMin(extractAttribute(attributes, "MIN", Integer.class));
    284                         builder.setMax(extractAttribute(attributes, "MAX", Integer.class));
    285                         builder.setDef(extractAttribute(attributes, "DEF", Integer.class));
    286                         builder.setDef(getAttribute(attributes, "DEF"));
     277                        builder.min(extractAttribute(attributes, "MIN", Integer.class));
     278                        builder.max(extractAttribute(attributes, "MAX", Integer.class));
     279                        builder.def(extractAttribute(attributes, "DEF", Integer.class));
     280                        builder.def(getAttribute(attributes, "DEF"));
    287281                } else {
    288                         builder.setType(type);
    289                 }
    290                 return builder.build();
     282                        builder.type(type);
     283                }
     284                return builder.finish();
    291285        }
    292286
Note: See TracChangeset for help on using the changeset viewer.