@@ -23,9 +23,9 @@ final class MetaExtractor {
2323 private static final String META_ELEMENT_TAG = "TextEntry" ;
2424 private static final String META_ATTRIBUTE = "value" ;
2525
26- private final Pattern widthHeightPattern = Pattern .compile ("(?:width\\ s=\\ s(\\ d+))\n \t (?:height\\ s=\\ s(\\ d+))" );
27- private final Pattern statePattern = Pattern .compile ("(?:state\\ s=\\ s\" .*\" (?:\\ n\\ t.*)+)" );
28- private final Pattern paramPattern = Pattern .compile ("(\\ w+)\\ s=\\ s(.+)" );
26+ private static final Pattern WIDTH_HEIGHT = Pattern .compile ("(?:width\\ s=\\ s(\\ d+))\n \t (?:height\\ s=\\ s(\\ d+))" );
27+ private static final Pattern STATE_PATTERN = Pattern .compile ("(?:state\\ s=\\ s\" .*\" (?:\\ n\\ t.*)+)" );
28+ private static final Pattern PARAM_PATTERN = Pattern .compile ("(\\ w+)\\ s=\\ s(.+)" );
2929
3030 private static final String STATE = "state" ;
3131 private static final String DIRS = "dirs" ;
@@ -65,7 +65,7 @@ private IIOMetadata readMetadata(final InputStream input) {
6565
6666 private DmiMeta parseMetadataText (final String metadataText ) {
6767 DmiMeta metadata = new DmiMeta ();
68- Matcher widthHeight = widthHeightPattern .matcher (metadataText );
68+ Matcher widthHeight = WIDTH_HEIGHT .matcher (metadataText );
6969
7070 if (widthHeight .find () && Objects .nonNull (widthHeight .group (1 )) && Objects .nonNull (widthHeight .group (2 ))) {
7171 metadata .setSpritesWidth (Integer .parseInt (widthHeight .group (1 )));
@@ -74,7 +74,7 @@ private DmiMeta parseMetadataText(final String metadataText) {
7474 throw new IllegalArgumentException ("DMI meta does't contain width and height properties" );
7575 }
7676
77- Matcher state = statePattern .matcher (metadataText );
77+ Matcher state = STATE_PATTERN .matcher (metadataText );
7878
7979 if (state .find ()) {
8080 state .reset ();
@@ -101,7 +101,7 @@ private DmiMeta parseMetadataText(final String metadataText) {
101101
102102 private Meta parseState (final String stateText ) {
103103 Meta metaEntry = new Meta ();
104- Matcher stateParam = paramPattern .matcher (stateText );
104+ Matcher stateParam = PARAM_PATTERN .matcher (stateText );
105105
106106 while (stateParam .find ()) {
107107 final String paramName = stateParam .group (1 );
0 commit comments