rt/aot/src/main/java/org/apidesign/bck2brwsr/aot/Bck2BrwsrJars.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 15 Apr 2015 11:51:04 +0200
branchSwitchFlow
changeset 1821 3726b0a034d5
parent 1787 ea12a3bb4b33
child 1829 729dc3c25fd8
permissions -rw-r--r--
Remove initial / if present
jaroslav@1599
     1
/**
jaroslav@1599
     2
 * Back 2 Browser Bytecode Translator
jaroslav@1787
     3
 * Copyright (C) 2012-2015 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@1599
     4
 *
jaroslav@1599
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@1599
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@1599
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@1599
     8
 *
jaroslav@1599
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@1599
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@1599
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@1599
    12
 * GNU General Public License for more details.
jaroslav@1599
    13
 *
jaroslav@1599
    14
 * You should have received a copy of the GNU General Public License
jaroslav@1599
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@1599
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@1599
    17
 */
jaroslav@1599
    18
package org.apidesign.bck2brwsr.aot;
jaroslav@1599
    19
jaroslav@1599
    20
import java.io.BufferedReader;
jaroslav@1684
    21
import java.io.ByteArrayInputStream;
jaroslav@1599
    22
import java.io.File;
jaroslav@1679
    23
import java.io.FileInputStream;
jaroslav@1599
    24
import java.io.IOException;
jaroslav@1599
    25
import java.io.InputStream;
jaroslav@1599
    26
import java.io.InputStreamReader;
jaroslav@1599
    27
import java.net.URL;
jaroslav@1599
    28
import java.util.ArrayList;
jaroslav@1599
    29
import java.util.Enumeration;
jaroslav@1678
    30
import java.util.HashMap;
jaroslav@1599
    31
import java.util.HashSet;
jaroslav@1599
    32
import java.util.List;
jaroslav@1678
    33
import java.util.Map;
jaroslav@1599
    34
import java.util.Set;
jaroslav@1724
    35
import java.util.jar.Attributes;
jaroslav@1599
    36
import java.util.jar.JarEntry;
jaroslav@1599
    37
import java.util.jar.JarFile;
jaroslav@1599
    38
import java.util.logging.Level;
jaroslav@1599
    39
import java.util.logging.Logger;
jaroslav@1599
    40
import java.util.zip.ZipEntry;
jaroslav@1599
    41
import org.apidesign.vm4brwsr.Bck2Brwsr;
jaroslav@1599
    42
jaroslav@1599
    43
/** Utilities to process JAR files and set a compiler
jaroslav@1603
    44
 * up.
jaroslav@1599
    45
 *
jaroslav@1603
    46
 * @since 0.9
jaroslav@1599
    47
 * @author Jaroslav Tulach
jaroslav@1599
    48
 */
jaroslav@1599
    49
public final class Bck2BrwsrJars {
jaroslav@1599
    50
    private static final Logger LOG = Logger.getLogger(Bck2BrwsrJars.class.getName());
jaroslav@1679
    51
jaroslav@1599
    52
    private Bck2BrwsrJars() {
jaroslav@1599
    53
    }
jaroslav@1599
    54
    
jaroslav@1599
    55
    /** Creates new compiler pre-configured from the content of 
jaroslav@1599
    56
     * provided JAR file. The compiler will compile all classes.
jaroslav@1729
    57
     * The system understands OSGi manifest entries and NetBeans
jaroslav@1729
    58
     * module system manifest entries and will export
jaroslav@1599
    59
     * all packages that are exported in the JAR file. The system
jaroslav@1628
    60
     * also recognizes META-INF/services and makes sure the class names
jaroslav@1599
    61
     * are not mangled.
jaroslav@1599
    62
     * 
jaroslav@1599
    63
     * @param c the compiler to {@link Bck2Brwsr#addClasses(java.lang.String...) add classes},
jaroslav@1599
    64
     *    {@link Bck2Brwsr#addResources(java.lang.String...) add resources} and
jaroslav@1599
    65
     *    {@link Bck2Brwsr#addExported(java.lang.String...) exported objects} to.
jaroslav@1599
    66
     *    Can be <code>null</code> - in such case an 
jaroslav@1599
    67
     *    {@link Bck2Brwsr#newCompiler() empty compiler} is constructed.
jaroslav@1599
    68
     * @param jar the file to process
jaroslav@1599
    69
     * @return newly configured compiler
jaroslav@1599
    70
     * @throws IOException if something goes wrong
jaroslav@1599
    71
     */
jaroslav@1599
    72
    public static Bck2Brwsr configureFrom(Bck2Brwsr c, File jar) throws IOException {
jaroslav@1710
    73
        return configureFrom(c, jar, null);
jaroslav@1710
    74
    }
jaroslav@1710
    75
    
jaroslav@1710
    76
    /** Creates new compiler pre-configured from the content of 
jaroslav@1710
    77
     * provided JAR file. The compiler will compile all classes.
jaroslav@1729
    78
     * The system understands OSGi manifest entries and NetBeans
jaroslav@1729
    79
     * module system manifest entries and will export
jaroslav@1710
    80
     * all packages that are exported in the JAR file. The system
jaroslav@1710
    81
     * also recognizes META-INF/services and makes sure the class names
jaroslav@1710
    82
     * are not mangled.
jaroslav@1710
    83
     * 
jaroslav@1710
    84
     * @param c the compiler to {@link Bck2Brwsr#addClasses(java.lang.String...) add classes},
jaroslav@1710
    85
     *    {@link Bck2Brwsr#addResources(java.lang.String...) add resources} and
jaroslav@1710
    86
     *    {@link Bck2Brwsr#addExported(java.lang.String...) exported objects} to.
jaroslav@1710
    87
     *    Can be <code>null</code> - in such case an 
jaroslav@1710
    88
     *    {@link Bck2Brwsr#newCompiler() empty compiler} is constructed.
jaroslav@1710
    89
     * @param jar the file to process
jaroslav@1710
    90
     * @param classpath additional resources to make available during
jaroslav@1710
    91
     *   compilation, but not include them in the generated JavaScript
jaroslav@1710
    92
     * @return newly configured compiler
jaroslav@1710
    93
     * @throws IOException if something goes wrong
jaroslav@1710
    94
     * @since 0.11
jaroslav@1710
    95
     */
jaroslav@1710
    96
    public static Bck2Brwsr configureFrom(
jaroslav@1710
    97
        Bck2Brwsr c, File jar, final ClassLoader classpath
jaroslav@1710
    98
    ) throws IOException {
jaroslav@1769
    99
        return configureFrom(c, jar, classpath, true);
jaroslav@1769
   100
    }
jaroslav@1769
   101
    
jaroslav@1769
   102
    /** Creates new compiler pre-configured from the content of 
jaroslav@1769
   103
     * provided JAR file. The compiler will compile all classes.
jaroslav@1769
   104
     * The system understands OSGi manifest entries and NetBeans
jaroslav@1769
   105
     * module system manifest entries and will export
jaroslav@1769
   106
     * all packages that are exported in the JAR file. The system
jaroslav@1769
   107
     * also recognizes META-INF/services and makes sure the class names
jaroslav@1769
   108
     * are not mangled.
jaroslav@1769
   109
     * 
jaroslav@1769
   110
     * @param c the compiler to {@link Bck2Brwsr#addClasses(java.lang.String...) add classes},
jaroslav@1769
   111
     *    {@link Bck2Brwsr#addResources(java.lang.String...) add resources} and
jaroslav@1769
   112
     *    {@link Bck2Brwsr#addExported(java.lang.String...) exported objects} to.
jaroslav@1769
   113
     *    Can be <code>null</code> - in such case an 
jaroslav@1769
   114
     *    {@link Bck2Brwsr#newCompiler() empty compiler} is constructed.
jaroslav@1769
   115
     * @param jar the file to process
jaroslav@1769
   116
     * @param classpath additional resources to make available during
jaroslav@1769
   117
     *   compilation, but not include them in the generated JavaScript
jaroslav@1769
   118
     * @param ignoreBootClassPath should we ignore classes on bootclasspath?
jaroslav@1769
   119
     * @return newly configured compiler
jaroslav@1769
   120
     * @throws IOException if something goes wrong
jaroslav@1769
   121
     * @since 0.14
jaroslav@1769
   122
     */
jaroslav@1769
   123
    public static Bck2Brwsr configureFrom(
jaroslav@1769
   124
        Bck2Brwsr c, File jar, final ClassLoader classpath, final boolean ignoreBootClassPath
jaroslav@1769
   125
    ) throws IOException {
jaroslav@1679
   126
        if (jar.isDirectory()) {
jaroslav@1769
   127
            return configureDir(ignoreBootClassPath, c, jar, classpath);
jaroslav@1679
   128
        }
jaroslav@1601
   129
        final JarFile jf = new JarFile(jar);
jaroslav@1678
   130
        final List<String> classes = new ArrayList<>();
jaroslav@1601
   131
        List<String> resources = new ArrayList<>();
jaroslav@1601
   132
        Set<String> exported = new HashSet<>();
jaroslav@1601
   133
        class JarRes extends EmulationResources implements Bck2Brwsr.Resources {
jaroslav@1678
   134
            JarRes() {
jaroslav@1769
   135
                super(ignoreBootClassPath, classpath, classes);
jaroslav@1678
   136
            }
jaroslav@1601
   137
            @Override
jaroslav@1601
   138
            public InputStream get(String resource) throws IOException {
jaroslav@1696
   139
                InputStream is = getConverted(resource);
jaroslav@1696
   140
                if (is != null) {
jaroslav@1696
   141
                    return is;
jaroslav@1696
   142
                }
jaroslav@1821
   143
                if (resource.startsWith("/")) {
jaroslav@1821
   144
                    resource = resource.substring(1);
jaroslav@1821
   145
                }
jaroslav@1696
   146
                is = jf.getInputStream(new ZipEntry(resource));
jaroslav@1601
   147
                return is == null ? super.get(resource) : is;
jaroslav@1599
   148
            }
jaroslav@1599
   149
        }
jaroslav@1678
   150
        JarRes jarRes = new JarRes();
jaroslav@1678
   151
jaroslav@1678
   152
        listJAR(jf, jarRes, resources, exported);
jaroslav@1678
   153
        
jaroslav@1678
   154
        String cp = jf.getManifest().getMainAttributes().getValue("Class-Path"); // NOI18N
jaroslav@1710
   155
        String[] parts = cp == null ? new String[0] : cp.split(" ");
jaroslav@1678
   156
jaroslav@1622
   157
        if (c == null) {
jaroslav@1622
   158
            c = Bck2Brwsr.newCompiler();
jaroslav@1622
   159
        }
jaroslav@1622
   160
        
jaroslav@1622
   161
        return c
jaroslav@1710
   162
            .library(parts)
jaroslav@1601
   163
            .addClasses(classes.toArray(new String[classes.size()]))
jaroslav@1601
   164
            .addExported(exported.toArray(new String[exported.size()]))
jaroslav@1601
   165
            .addResources(resources.toArray(new String[resources.size()]))
jaroslav@1678
   166
            .resources(jarRes);
jaroslav@1599
   167
    }
jaroslav@1599
   168
    
jaroslav@1599
   169
    private static void listJAR(
jaroslav@1678
   170
        JarFile j, EmulationResources classes,
jaroslav@1599
   171
        List<String> resources, Set<String> keep
jaroslav@1599
   172
    ) throws IOException {
jaroslav@1599
   173
        Enumeration<JarEntry> en = j.entries();
jaroslav@1599
   174
        while (en.hasMoreElements()) {
jaroslav@1599
   175
            JarEntry e = en.nextElement();
jaroslav@1599
   176
            final String n = e.getName();
jaroslav@1599
   177
            if (n.endsWith("/")) {
jaroslav@1599
   178
                continue;
jaroslav@1599
   179
            }
jaroslav@1602
   180
            if (n.startsWith("META-INF/maven/")) {
jaroslav@1602
   181
                continue;
jaroslav@1602
   182
            }
jaroslav@1599
   183
            int last = n.lastIndexOf('/');
jaroslav@1599
   184
            String pkg = n.substring(0, last + 1);
jaroslav@1599
   185
            if (pkg.startsWith("java/")) {
jaroslav@1599
   186
                keep.add(pkg);
jaroslav@1599
   187
            }
jaroslav@1599
   188
            if (n.endsWith(".class")) {
jaroslav@1678
   189
                classes.addClassResource(n);
jaroslav@1599
   190
            } else {
jaroslav@1599
   191
                resources.add(n);
jaroslav@1599
   192
                if (n.startsWith("META-INF/services/") && keep != null) {
jaroslav@1599
   193
                    BufferedReader r = new BufferedReader(new InputStreamReader(j.getInputStream(e)));
jaroslav@1599
   194
                    for (;;) {
jaroslav@1599
   195
                        String l = r.readLine();
jaroslav@1599
   196
                        if (l == null) {
jaroslav@1599
   197
                            break;
jaroslav@1599
   198
                        }
jaroslav@1599
   199
                        if (l.startsWith("#")) {
jaroslav@1599
   200
                            continue;
jaroslav@1599
   201
                        }
jaroslav@1599
   202
                        keep.add(l.replace('.', '/'));
jaroslav@1599
   203
                    }
jaroslav@1764
   204
                    r.close();
jaroslav@1599
   205
                }
jaroslav@1599
   206
            }
jaroslav@1599
   207
        }
jaroslav@1724
   208
        if (keep != null) {
jaroslav@1724
   209
            final Attributes mainAttr = j.getManifest().getMainAttributes();
jaroslav@1724
   210
            exportPublicPackages(mainAttr, keep);
jaroslav@1724
   211
        }
jaroslav@1724
   212
    }
jaroslav@1724
   213
jaroslav@1724
   214
    static void exportPublicPackages(final Attributes mainAttr, Set<String> keep) {
jaroslav@1724
   215
        String exp = mainAttr.getValue("Export-Package"); // NOI18N
jaroslav@1724
   216
        if (exp != null) {
jaroslav@1599
   217
            for (String def : exp.split(",")) {
jaroslav@1599
   218
                for (String sep : def.split(";")) {
jaroslav@1599
   219
                    keep.add(sep.replace('.', '/') + "/");
jaroslav@1599
   220
                    break;
jaroslav@1599
   221
                }
jaroslav@1599
   222
            }
jaroslav@1728
   223
            return;
jaroslav@1728
   224
        }
jaroslav@1728
   225
        exp = mainAttr.getValue("OpenIDE-Module-Public-Packages");
jaroslav@1728
   226
        if (exp != null) {
jaroslav@1728
   227
            for (String def : exp.split(",")) {
jaroslav@1728
   228
                def = def.trim();
jaroslav@1728
   229
                if (def.endsWith(".*")) {
jaroslav@1728
   230
                    keep.add(def.substring(0, def.length() - 1).replace('.', '/'));
jaroslav@1728
   231
                }
jaroslav@1728
   232
            }
jaroslav@1599
   233
        }
jaroslav@1599
   234
    }
jaroslav@1678
   235
    
jaroslav@1678
   236
    static byte[] readFrom(InputStream is) throws IOException {
jaroslav@1678
   237
        int expLen = is.available();
jaroslav@1678
   238
        if (expLen < 1) {
jaroslav@1678
   239
            expLen = 1;
jaroslav@1678
   240
        }
jaroslav@1678
   241
        byte[] arr = new byte[expLen];
jaroslav@1678
   242
        int pos = 0;
jaroslav@1678
   243
        for (;;) {
jaroslav@1678
   244
            int read = is.read(arr, pos, arr.length - pos);
jaroslav@1678
   245
            if (read == -1) {
jaroslav@1678
   246
                break;
jaroslav@1678
   247
            }
jaroslav@1678
   248
            pos += read;
jaroslav@1678
   249
            if (pos == arr.length) {
jaroslav@1678
   250
                byte[] tmp = new byte[arr.length * 2];
jaroslav@1678
   251
                System.arraycopy(arr, 0, tmp, 0, arr.length);
jaroslav@1678
   252
                arr = tmp;
jaroslav@1678
   253
            }
jaroslav@1678
   254
        }
jaroslav@1678
   255
        if (pos != arr.length) {
jaroslav@1678
   256
            byte[] tmp = new byte[pos];
jaroslav@1678
   257
            System.arraycopy(arr, 0, tmp, 0, pos);
jaroslav@1678
   258
            arr = tmp;
jaroslav@1678
   259
        }
jaroslav@1678
   260
        return arr;
jaroslav@1678
   261
    }
jaroslav@1678
   262
    
jaroslav@1599
   263
jaroslav@1599
   264
    static class EmulationResources implements Bck2Brwsr.Resources {
jaroslav@1678
   265
        private final List<String> classes;
jaroslav@1678
   266
        private final Map<String,byte[]> converted = new HashMap<>();
jaroslav@1678
   267
        private final BytecodeProcessor proc;
jaroslav@1710
   268
        private final ClassLoader cp;
jaroslav@1769
   269
        private final boolean ignoreBootClassPath;
jaroslav@1678
   270
jaroslav@1769
   271
        protected EmulationResources(boolean ignoreBootClassPath, ClassLoader cp, List<String> classes) {
jaroslav@1769
   272
            this.ignoreBootClassPath = ignoreBootClassPath;
jaroslav@1678
   273
            this.classes = classes;
jaroslav@1710
   274
            this.cp = cp != null ? cp : Bck2BrwsrJars.class.getClassLoader();
jaroslav@1678
   275
            BytecodeProcessor p;
jaroslav@1678
   276
            try {
jaroslav@1678
   277
                Class<?> bpClass = Class.forName("org.apidesign.bck2brwsr.aot.RetroLambda");
jaroslav@1678
   278
                p = (BytecodeProcessor) bpClass.newInstance();
jaroslav@1678
   279
            } catch (Throwable t) {
jaroslav@1678
   280
                p = null;
jaroslav@1678
   281
            }
jaroslav@1678
   282
            this.proc = p;
jaroslav@1678
   283
        }
jaroslav@1599
   284
jaroslav@1696
   285
        protected final InputStream getConverted(String name) throws IOException {
jaroslav@1684
   286
            byte[] arr = converted.get(name);
jaroslav@1684
   287
            if (arr != null) {
jaroslav@1684
   288
                return new ByteArrayInputStream(arr);
jaroslav@1684
   289
            }
jaroslav@1696
   290
            return null;
jaroslav@1696
   291
        }
jaroslav@1696
   292
        
jaroslav@1696
   293
        @Override
jaroslav@1696
   294
        public InputStream get(String name) throws IOException {
jaroslav@1696
   295
            InputStream is = getConverted(name);
jaroslav@1696
   296
            if (is != null) {
jaroslav@1696
   297
                return is;
jaroslav@1696
   298
            }
jaroslav@1710
   299
            Enumeration<URL> en = cp.getResources(name);
jaroslav@1599
   300
            URL u = null;
jaroslav@1599
   301
            while (en.hasMoreElements()) {
jaroslav@1599
   302
                u = en.nextElement();
jaroslav@1599
   303
            }
jaroslav@1599
   304
            if (u == null) {
jaroslav@1763
   305
                LOG.log(Level.FINE, "Cannot find {0}", name);
jaroslav@1599
   306
                return null;
jaroslav@1599
   307
            }
jaroslav@1769
   308
            if (ignoreBootClassPath && u.toExternalForm().contains("/rt.jar!")) {
jaroslav@1763
   309
                LOG.log(Level.WARNING, "No bootdelegation for {0}", name);
jaroslav@1599
   310
                return null;
jaroslav@1599
   311
            }
jaroslav@1599
   312
            return u.openStream();
jaroslav@1599
   313
        }
jaroslav@1678
   314
jaroslav@1678
   315
        private void addClassResource(String n) throws IOException {
jaroslav@1678
   316
            if (proc != null) {
jaroslav@1678
   317
                try (InputStream is = this.get(n)) {
jaroslav@1678
   318
                    Map<String, byte[]> conv = proc.process(n, readFrom(is), this);
jaroslav@1678
   319
                    if (conv != null) {
jaroslav@1681
   320
                        boolean found = false;
jaroslav@1681
   321
                        for (Map.Entry<String, byte[]> entrySet : conv.entrySet()) {
jaroslav@1681
   322
                            String res = entrySet.getKey();
jaroslav@1681
   323
                            byte[] bytes = entrySet.getValue();
jaroslav@1681
   324
                            if (res.equals(n)) {
jaroslav@1681
   325
                                found = true;
jaroslav@1681
   326
                            }
jaroslav@1684
   327
                            assert res.endsWith(".class") : "Wrong resource: " + res;
jaroslav@1681
   328
                            converted.put(res, bytes);
jaroslav@1681
   329
                            classes.add(res.substring(0, res.length() - 6));
jaroslav@1681
   330
                        }
jaroslav@1681
   331
                        if (!found) {
jaroslav@1678
   332
                            throw new IOException("Cannot find " + n + " among " + conv);
jaroslav@1678
   333
                        }
jaroslav@1678
   334
                        return;
jaroslav@1678
   335
                    }
jaroslav@1678
   336
                }
jaroslav@1678
   337
            }
jaroslav@1678
   338
            classes.add(n.substring(0, n.length() - 6));
jaroslav@1678
   339
        }
jaroslav@1599
   340
    }
jaroslav@1599
   341
    
jaroslav@1769
   342
    private static Bck2Brwsr configureDir(final boolean ignoreBootClassPath, Bck2Brwsr c, final File dir, ClassLoader cp) throws IOException {
jaroslav@1679
   343
        List<String> arr = new ArrayList<>();
jaroslav@1679
   344
        List<String> classes = new ArrayList<>();
jaroslav@1679
   345
        class DirRes extends EmulationResources {
jaroslav@1710
   346
            public DirRes(ClassLoader cp, List<String> classes) {
jaroslav@1769
   347
                super(ignoreBootClassPath, cp, classes);
jaroslav@1679
   348
            }
jaroslav@1679
   349
jaroslav@1679
   350
            @Override
jaroslav@1679
   351
            public InputStream get(String name) throws IOException {
jaroslav@1679
   352
                InputStream is = super.get(name);
jaroslav@1679
   353
                if (is != null) {
jaroslav@1679
   354
                    return is;
jaroslav@1679
   355
                }
jaroslav@1679
   356
                File r = new File(dir, name.replace('/', File.separatorChar));
jaroslav@1679
   357
                if (r.exists()) {
jaroslav@1679
   358
                    return new FileInputStream(r);
jaroslav@1679
   359
                }
jaroslav@1679
   360
                return null;
jaroslav@1679
   361
            }
jaroslav@1679
   362
        }
jaroslav@1710
   363
        DirRes dirRes = new DirRes(cp, classes);
jaroslav@1679
   364
        listDir(dir, null, dirRes, arr);
jaroslav@1679
   365
        if (c == null) {
jaroslav@1679
   366
            c = Bck2Brwsr.newCompiler();
jaroslav@1679
   367
        }
jaroslav@1679
   368
        return c
jaroslav@1679
   369
        .addRootClasses(classes.toArray(new String[0]))
jaroslav@1679
   370
        .addResources(arr.toArray(new String[0]))
jaroslav@1679
   371
        .library()
jaroslav@1679
   372
        //.obfuscation(ObfuscationLevel.FULL)
jaroslav@1679
   373
        .resources(dirRes);
jaroslav@1679
   374
    }
jaroslav@1679
   375
jaroslav@1679
   376
    private static void listDir(
jaroslav@1679
   377
        File f, String pref, EmulationResources res, List<String> resources
jaroslav@1679
   378
    ) throws IOException {
jaroslav@1679
   379
        File[] arr = f.listFiles();
jaroslav@1679
   380
        if (arr == null) {
jaroslav@1679
   381
            if (f.getName().endsWith(".class")) {
jaroslav@1679
   382
                res.addClassResource(pref + f.getName());
jaroslav@1679
   383
            } else {
jaroslav@1679
   384
                resources.add(pref + f.getName());
jaroslav@1679
   385
            }
jaroslav@1679
   386
        } else {
jaroslav@1679
   387
            for (File ch : arr) {
jaroslav@1679
   388
                listDir(ch, pref == null ? "" : pref + f.getName() + "/", res, resources);
jaroslav@1679
   389
            }
jaroslav@1679
   390
        }
jaroslav@1679
   391
    }
jaroslav@1678
   392
    
jaroslav@1599
   393
}