~ubuntu-branches/ubuntu/trusty/mysql-connector-java/trusty

« back to all changes in this revision

Viewing changes to src/com/mysql/jdbc/Util.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg, Miguel Landaeta
  • Date: 2013-07-02 17:07:51 UTC
  • mfrom: (1.1.8) (3.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20130702170751-f4rszjabxg0391fr
Tags: 5.1.25-1
* New upstream release
* Refreshed the patches
* Added a patch to build with one JDK and removed the build
  dependency on java-gcj-compat-dev
* Updated Standards-Version to 3.9.4 (no changes)
* Use canonical URLs for the Vcs-* fields
* debian/rules: Improved the clean target to allow rebuilds
* Updated the watch file
* Renamed debian/README.Debian-source to README.source

[ Miguel Landaeta ] 
* Fix FTBFS with OpenJDK 7 (Closes: #706668)
* Remove Michael Koch from Uploaders list.
  Thanks for your work on this package. (Closes: #654122).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
 
2
 Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
3
3
 
4
4
 
5
5
  The MySQL Connector/J is licensed under the terms of the GPLv2
138
138
        }
139
139
 
140
140
        // Right from Monty's code
141
 
        static String newCrypt(String password, String seed) {
 
141
        public static String newCrypt(String password, String seed) {
142
142
                byte b;
143
143
                double d;
144
144
 
197
197
                return result;
198
198
        }
199
199
 
200
 
        static String oldCrypt(String password, String seed) {
 
200
        public static String oldCrypt(String password, String seed) {
201
201
                long hp;
202
202
                long hm;
203
203
                long s1;
332
332
                                to[i] ^= extra;
333
333
                        }
334
334
 
335
 
                        val = new String(to);
 
335
                        val = StringUtils.toString(to);
336
336
                }
337
337
 
338
338
                return val;
379
379
                return traceBuf.toString();
380
380
        }
381
381
 
382
 
        public static Object getInstance(String className, Class[] argTypes,
 
382
        public static Object getInstance(String className, Class<?>[] argTypes,
383
383
                        Object[] args, ExceptionInterceptor exceptionInterceptor) throws SQLException {
384
384
 
385
385
                try {
404
404
         * Handles constructing new instance with the given constructor and wrapping
405
405
         * (or not, as required) the exceptions that could possibly be generated
406
406
         */
407
 
        public static final Object handleNewInstance(Constructor ctor, Object[] args, ExceptionInterceptor exceptionInterceptor)
 
407
        public static final Object handleNewInstance(Constructor<?> ctor, Object[] args, ExceptionInterceptor exceptionInterceptor)
408
408
                        throws SQLException {
409
409
                try {
410
410
 
447
447
         */
448
448
        public static boolean interfaceExists(String hostname) {
449
449
                try {
450
 
                        Class networkInterfaceClass = Class
 
450
                        Class<?> networkInterfaceClass = Class
451
451
                                        .forName("java.net.NetworkInterface");
452
452
                        return networkInterfaceClass.getMethod("getByName", (Class[])null).invoke(
453
453
                                        networkInterfaceClass, new Object[] { hostname }) != null;
493
493
                return System.currentTimeMillis();
494
494
        }
495
495
        
 
496
        @SuppressWarnings({ "rawtypes", "unchecked" })
496
497
        public static void resultSetToMap(Map mappedValues, java.sql.ResultSet rs)
497
498
                        throws SQLException {
498
499
                while (rs.next()) {
500
501
                }
501
502
        }
502
503
 
503
 
        public static Map calculateDifferences(Map map1, Map map2) {
504
 
                Map diffMap = new HashMap();
505
 
 
506
 
                Iterator map1Entries = map1.entrySet().iterator();
507
 
 
508
 
                while (map1Entries.hasNext()) {
509
 
                        Map.Entry entry = (Map.Entry) map1Entries.next();
 
504
        @SuppressWarnings({ "rawtypes", "unchecked" })
 
505
        public static void resultSetToMap(Map mappedValues, java.sql.ResultSet rs, int key, int value)
 
506
                        throws SQLException {
 
507
                while (rs.next()) {
 
508
                        mappedValues.put(rs.getObject(key), rs.getObject(value));
 
509
                }
 
510
        }
 
511
        
 
512
        @SuppressWarnings({ "rawtypes", "unchecked" })
 
513
        public static void resultSetToMap(Map mappedValues, java.sql.ResultSet rs, String key, String value)
 
514
                        throws SQLException {
 
515
                while (rs.next()) {
 
516
                        mappedValues.put(rs.getObject(key), rs.getObject(value));
 
517
                }
 
518
        }
 
519
        
 
520
        public static Map<Object, Object> calculateDifferences(Map<?,?> map1, Map<?,?> map2) {
 
521
                Map<Object, Object> diffMap = new HashMap<Object, Object>();
 
522
 
 
523
                for (Map.Entry<?,?> entry : map1.entrySet()) {
510
524
                        Object key = entry.getKey();
511
525
 
512
526
                        Number value1 = null;
563
577
                return diffMap;
564
578
        }
565
579
        
566
 
        public static List loadExtensions(Connection conn,
 
580
        public static List<Extension> loadExtensions(Connection conn,
567
581
                        Properties props, String extensionClassNames,
568
582
                        String errorMessageKey, ExceptionInterceptor exceptionInterceptor) throws SQLException {
569
 
                List extensionList = new LinkedList();
 
583
                List<Extension> extensionList = new LinkedList<Extension>();
570
584
 
571
 
                List interceptorsToCreate = StringUtils.split(extensionClassNames, ",",
 
585
                List<String> interceptorsToCreate = StringUtils.split(extensionClassNames, ",",
572
586
                                true);
573
587
 
574
 
                Iterator iter = interceptorsToCreate.iterator();
 
588
                Iterator<String> iter = interceptorsToCreate.iterator();
575
589
 
576
590
                String className = null;
577
591