diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-13 10:08:31 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-13 10:24:10 +0200 |
commit | 34bcf9b498bccb5c924f4cec850ff15d88df6f07 (patch) | |
tree | 4d9604ec8c3b73639338ec45a0618b5daa5cf0ed /qadevOOo/runner/convwatch | |
parent | 347926e8e57c1825261daa46c1886aa2ebf9571b (diff) |
java: remove dead methods
found by UCDetector
Change-Id: I219caa8e680dba5a395541a778df6144841c4dde
Diffstat (limited to 'qadevOOo/runner/convwatch')
-rw-r--r-- | qadevOOo/runner/convwatch/DBHelper.java | 37 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/DirectoryHelper.java | 8 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/FileHelper.java | 7 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/FilenameHelper.java | 8 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java | 11 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/HTMLOutputter.java | 155 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/INIOutputter.java | 5 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/IniFile.java | 81 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/LISTOutputter.java | 12 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/OfficePrint.java | 28 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/PRNCompare.java | 23 | ||||
-rw-r--r-- | qadevOOo/runner/convwatch/PixelCounter.java | 18 |
12 files changed, 7 insertions, 386 deletions
diff --git a/qadevOOo/runner/convwatch/DBHelper.java b/qadevOOo/runner/convwatch/DBHelper.java index 12b2651613b0..e6381f027ccf 100644 --- a/qadevOOo/runner/convwatch/DBHelper.java +++ b/qadevOOo/runner/convwatch/DBHelper.java @@ -188,44 +188,7 @@ public class DBHelper aSQLThread.start(); } - public int QueryIntFromSQL(Connection _aCon, String _sSQL, String _sColumnName) - throws ValueNotFoundException - { - Statement oStmt = null; - int nValue = 0; - try - { - oStmt = _aCon.createStatement(); - - ResultSet oResult = oStmt.executeQuery(_sSQL); - oResult.next(); - try - { - if (_sColumnName.length() == 0) - { - // take the first row value (started with 1) - nValue = oResult.getInt(1); - } - else - { - nValue = oResult.getInt(_sColumnName); - } - } - catch (SQLException e) - { - String sError = e.getMessage(); - GlobalLogWriter.get().println("DB: Original SQL error: " + sError); - throw new ValueNotFoundException("Can't execute SQL: " + _sSQL); - } - } - catch(SQLException e) - { - String sError = e.getMessage(); - GlobalLogWriter.get().println("DB: Couldn't execute sql string " + _sSQL + "\n" + sError); - } - return nValue; - } public String Quote(String _sToQuote) { diff --git a/qadevOOo/runner/convwatch/DirectoryHelper.java b/qadevOOo/runner/convwatch/DirectoryHelper.java index ac0b94de12c7..ee338d3e09d5 100644 --- a/qadevOOo/runner/convwatch/DirectoryHelper.java +++ b/qadevOOo/runner/convwatch/DirectoryHelper.java @@ -71,13 +71,7 @@ public class DirectoryHelper return a.m_aFileList.toArray(); } - public static Object[] traverse( String _sDirectory, boolean _bRecursiveIsAllowed ) - { - DirectoryHelper a = new DirectoryHelper(); - a.setRecursiveIsAllowed(_bRecursiveIsAllowed); - a.traverse_impl(_sDirectory, null); - return a.m_aFileList.toArray(); - } + private void traverse_impl( String afileDirectory, FileFilter _aFileFilter ) { diff --git a/qadevOOo/runner/convwatch/FileHelper.java b/qadevOOo/runner/convwatch/FileHelper.java index 221be5fa74be..3cf88eb267b4 100644 --- a/qadevOOo/runner/convwatch/FileHelper.java +++ b/qadevOOo/runner/convwatch/FileHelper.java @@ -39,12 +39,7 @@ public class FileHelper } - public static void MessageBox(String _sStr) - { - String sVersion = System.getProperty("java.version"); - String sOSName = System.getProperty("os.name"); - JOptionPane.showMessageDialog( null, _sStr, sVersion + " " + sOSName + " Hello World Debugger", JOptionPane.INFORMATION_MESSAGE ); - } + public static boolean exists(String _sFile) { diff --git a/qadevOOo/runner/convwatch/FilenameHelper.java b/qadevOOo/runner/convwatch/FilenameHelper.java index 9d2919fcaf95..bc64b148ee62 100644 --- a/qadevOOo/runner/convwatch/FilenameHelper.java +++ b/qadevOOo/runner/convwatch/FilenameHelper.java @@ -175,13 +175,7 @@ abstract class FilenameHelper_impl implements Filenamer return FileHelper.isDir(getSystemPath()); } - /** - * @return true, if the file really exist. - */ - public boolean exists() - { - return FileHelper.exists(createAbsoluteFilename()); - } + /** * @return the current suffix diff --git a/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java b/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java index 0f8182b998c7..23e975815837 100644 --- a/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java +++ b/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java @@ -191,16 +191,7 @@ public class GraphicalDifferenceCheck return bOk; } - /** - * Used for the comparance of graphical differences. - * Method compares one document (_sInputFile) with an older document of the same name in the provided directory (_sReferencePath). - * - * The path _sOutputPath must be writeable - */ - public static boolean checkOneFile(String _sInputFile, String _sOutputPath, String _sReferencePath, GraphicalTestArguments _aGTA) throws ConvWatchException - { - return checkOneFile( _sInputFile, _sOutputPath, _sReferencePath, null, _aGTA); - } + /** diff --git a/qadevOOo/runner/convwatch/HTMLOutputter.java b/qadevOOo/runner/convwatch/HTMLOutputter.java index 6425ec96816b..087101c97576 100644 --- a/qadevOOo/runner/convwatch/HTMLOutputter.java +++ b/qadevOOo/runner/convwatch/HTMLOutputter.java @@ -206,168 +206,13 @@ public class HTMLOutputter private final static String DIFFER_BM_TABLETITLE = "Diff file (RB)"; private final static String OK_TABLETITLE = "OK?"; - public void checkSection(String _sDocumentName) - { - try - { - m_aOut.write( "<H2>Results for the document " + _sDocumentName + "</H2>" + ls); - m_aOut.write( "<p>Legend:<br>"); - m_aOut.write( stronghtml(FIRSTGFX_TABLETITLE) + " contains the output printed via 'ghostscript' as a jpeg picture.<br>"); - m_aOut.write( stronghtml(SECONDGFX_TABLETITLE) + " contains the same document opened within OpenOffice.org also printed via ghostscript as jpeg.<br>"); - m_aOut.write( stronghtml(DIFFER_TABLETITLE)+" is build via composite from original and new picture. The result should be a whole black picture, if there are no differences.<br>At the moment "+stronghtml(STATUS_TABLETITLE)+" is only ok, if the difference file contains only one color (black).</p>" ); - m_aOut.write( stronghtml(DIFFER_BM_TABLETITLE) + " is build via composite from original and new picture after the border of both pictures are removed, so differences based on center problems may solved here"); - m_aOut.write( "</p>"); - m_aOut.write( "<p>Some words about the percentage value<br>"); - m_aOut.write( "If a character is on the original page (a) and on the new page this character is moved to an other position only (b) , this means the difference is 100%.<br>"); - m_aOut.write( "If character (b) is also bigger than character (a) the percentage is grow over the 100% mark.<br>"); - m_aOut.write( "This tool count only the pixels which are differ to it's background color. It makes no sense to count all pixels, or the difference percentage will most the time in a very low percentage range."); - m_aOut.write( "</p>"); - m_aOut.write( "<table class=\"infotable\">" + ls); - m_aOut.write( "<TR>" + ls); - m_aOut.write( tableHeaderCell( FIRSTGFX_TABLETITLE) ); - m_aOut.write( tableHeaderCell( SECONDGFX_TABLETITLE ) ); - m_aOut.write( tableHeaderCell(DIFFER_TABLETITLE ) ); - m_aOut.write( tableHeaderCell(PIXELDIFF_TABLETITLE ) ); - m_aOut.write( tableHeaderCell(DIFFER_BM_TABLETITLE) ); - m_aOut.write( tableHeaderCell(PIXELDIFF_BM_TABLETITLE ) ); - m_aOut.write( tableHeaderCell( OK_TABLETITLE) ); - m_aOut.write( "</TR>" + ls); - m_aOut.flush(); - } - catch (java.io.IOException e) - { - } - } - - public void checkLine(StatusHelper _aStatus, boolean _bCurrentResult) - { - try - { - m_aOut.write( "<TR>" + ls); - String sLink = getHREF(FileHelper.getBasename(_aStatus.m_sOldGfx), FileHelper.getBasename(_aStatus.m_sOldGfx)); - m_aOut.write( tableDataCell(sLink) ); - - sLink = getHREF(FileHelper.getBasename(_aStatus.m_sNewGfx), FileHelper.getBasename(_aStatus.m_sNewGfx)); - m_aOut.write( tableDataCell(sLink) ); - - sLink = getHREF(FileHelper.getBasename(_aStatus.m_sDiffGfx), FileHelper.getBasename(_aStatus.m_sDiffGfx)); - m_aOut.write( tableDataCell(sLink) ); - String sPercent = String.valueOf(_aStatus.nPercent) + "%"; - if (_aStatus.nPercent > 0 && _aStatus.nPercent < 5) - { - sPercent += " (less 5% is ok)"; - } - m_aOut.write(tableDataCell( sPercent ) ); - - if (_aStatus.m_sDiff_BM_Gfx == null) - { - sLink = "No diffs, therefore no moves"; - m_aOut.write( tableDataCell(sLink) ); - m_aOut.write(tableDataCell( "" ) ); - } - else - { - sLink = getHREF(FileHelper.getBasename(_aStatus.m_sDiff_BM_Gfx), FileHelper.getBasename(_aStatus.m_sDiff_BM_Gfx)); - m_aOut.write( tableDataCell(sLink) ); - - String sPercent2 = String.valueOf(_aStatus.nPercent2) + "%"; - if (_aStatus.nPercent2 > 0 && _aStatus.nPercent2 < 5) - { - sPercent2 += " (less 5% is ok)"; - } - m_aOut.write(tableDataCell( sPercent2 ) ); - } - - // is the check positiv, in a defined range - if (_bCurrentResult) - { - m_aOut.write(tableDataCell( "YES" ) ); - } - else - { - m_aOut.write(tableDataCell( "NO" ) ); - } - - m_aOut.write( "</TR>" + ls); - } - catch (java.io.IOException e) - { - } - } - public void checkDiffDiffSection(String _sDocumentName) - { - try - { - m_aOut.write( "<H2>Results for the document " + _sDocumentName + "</H2>" + ls); - - m_aOut.write( "<p>Legend:<br>"); - m_aOut.write( "</p>"); - - m_aOut.write( "<table class=\"infotable\">" + ls); - - m_aOut.write( "<TR>" + ls); - m_aOut.write( tableHeaderCell( "Source to actual difference" ) ); - m_aOut.write( tableHeaderCell( "Actual difference" ) ); - m_aOut.write( tableHeaderCell(DIFFER_TABLETITLE ) ); - m_aOut.write( tableHeaderCell(PIXELDIFF_TABLETITLE ) ); - - m_aOut.write( tableHeaderCell( OK_TABLETITLE) ); - - m_aOut.write( "</TR>" + ls); - m_aOut.flush(); - } - catch (java.io.IOException e) - { - } - } - - public void checkDiffDiffLine(StatusHelper _aStatus, boolean _bCurrentResult) - { - try - { - m_aOut.write( "<TR>" + ls); - // the link to the old difference can't offer here - - String sBasename = FileHelper.getBasename(m_sFilename); - String sNew = sBasename.substring(m_sNamePrefix.length()); - - String sLink; - sLink = getHREF(sNew, sNew); - m_aOut.write( tableDataCell(sLink) ); - - sLink = getHREF(FileHelper.getBasename(_aStatus.m_sNewGfx), FileHelper.getBasename(_aStatus.m_sNewGfx)); - m_aOut.write( tableDataCell(sLink) ); - - sLink = getHREF(FileHelper.getBasename(_aStatus.m_sDiffGfx), FileHelper.getBasename(_aStatus.m_sDiffGfx)); - m_aOut.write( tableDataCell(sLink) ); - - String sPercent = String.valueOf(_aStatus.nPercent) + "%"; - m_aOut.write(tableDataCell( sPercent ) ); - - // is the check positiv, in a defined range - if (_bCurrentResult) - { - m_aOut.write(tableDataCell( "YES" ) ); - } - else - { - m_aOut.write(tableDataCell( "NO" ) ); - } - - m_aOut.write( "</TR>" + ls); - } - catch (java.io.IOException e) - { - } - } - } diff --git a/qadevOOo/runner/convwatch/INIOutputter.java b/qadevOOo/runner/convwatch/INIOutputter.java index 673b8789be46..3c9745fbe198 100644 --- a/qadevOOo/runner/convwatch/INIOutputter.java +++ b/qadevOOo/runner/convwatch/INIOutputter.java @@ -98,10 +98,7 @@ public class INIOutputter } } - public void startSection(int _nNumber) - { - writeSection( "page" + String.valueOf(_nNumber)); - } + public void close() { diff --git a/qadevOOo/runner/convwatch/IniFile.java b/qadevOOo/runner/convwatch/IniFile.java index 1b3f46942dc5..dc3b55a50774 100644 --- a/qadevOOo/runner/convwatch/IniFile.java +++ b/qadevOOo/runner/convwatch/IniFile.java @@ -267,91 +267,10 @@ class IniFile return sValue; } - /** - write back the ini file to the disk, only if there exist changes - */ - public void store() - { - if (m_bListContainUnsavedChanges == false) - { - // nothing has changed, so no need to store - return; - } - File aFile = new File(m_sFilename); - if (aFile.exists()) - { - aFile.delete(); - if (aFile.exists()) - { - GlobalLogWriter.get().println("Couldn't delete the file " + m_sFilename); - return; - } - } - try - { - RandomAccessFile aWriter = new RandomAccessFile(aFile, "rw"); - for (int i=0; i<m_aList.size();i++) - { - String sLine = getItem(i); - aWriter.writeBytes(sLine); - aWriter.writeByte('\n'); - } - aWriter.close(); - } - catch (java.io.FileNotFoundException fne) - { - GlobalLogWriter.get().println("couldn't open file for writing " + m_sFilename); - GlobalLogWriter.get().println("Message: " + fne.getMessage()); - } - catch(java.io.IOException ie) - { - GlobalLogWriter.get().println("Exception occurs while writing to file " + m_sFilename); - GlobalLogWriter.get().println("Message: " + ie.getMessage()); - } - } - /** - insert a value - there are 3 cases - 1. section doesn't exist, goto end and insert a new section, insert a new key value pair - 2. section exist but key not, search section, search key, if key is -1 get last known key position and insert new key value pair there - 3. section exist and key exist, remove the old key and insert the key value pair at the same position - */ - public void insertValue(String _sSection, String _sKey, String _sValue) - { - int i = findSection(_sSection); - if (i == -1) - { - // case 1: section doesn't exist - String sFindSection = buildSectionName(_sSection); - - m_aList.add(sFindSection); - String sKeyValuePair = _sKey + "=" + _sValue; - m_aList.add(sKeyValuePair); - m_bListContainUnsavedChanges = true; - return; - } - int j = findKeyFromKnownSection(i, _sKey); - if (j == -1) - { - // case 2: section exist, but not the key - j = findLastKnownKeyIndex(i, _sKey); - String sKeyValuePair = _sKey + "=" + _sValue; - m_aList.add(j, sKeyValuePair); - m_bListContainUnsavedChanges = true; - return; - } - else - { - // case 3: section exist, and also the key - String sKeyValuePair = _sKey + "=" + _sValue; - m_aList.set(j, sKeyValuePair); - m_bListContainUnsavedChanges = true; - } - } } diff --git a/qadevOOo/runner/convwatch/LISTOutputter.java b/qadevOOo/runner/convwatch/LISTOutputter.java index 3053953f1f3c..175b32d3b2a6 100644 --- a/qadevOOo/runner/convwatch/LISTOutputter.java +++ b/qadevOOo/runner/convwatch/LISTOutputter.java @@ -56,17 +56,7 @@ public class LISTOutputter } public String getFilename() {return m_sFilename;} - public void createHeader() - { - try - { - m_aOut.write("# This file is automatically created by a convwatch run" + ls); - m_aOut.write("# " + ls); - } - catch (java.io.IOException e) - { - } - } + public void writeValue(String _sValue) { diff --git a/qadevOOo/runner/convwatch/OfficePrint.java b/qadevOOo/runner/convwatch/OfficePrint.java index 376d0a6edbe7..83da79d511d6 100644 --- a/qadevOOo/runner/convwatch/OfficePrint.java +++ b/qadevOOo/runner/convwatch/OfficePrint.java @@ -787,35 +787,7 @@ public class OfficePrint { // TODO: move this away! - static void showType(String _sInputURL, XMultiServiceFactory _xMSF) - { - if (_sInputURL.length() == 0) - { - return; - } - if (_xMSF == null) - { - GlobalLogWriter.get().println("MultiServiceFactory not set."); - return; - } - XTypeDetection aTypeDetection = null; - try - { - Object oObj = _xMSF.createInstance("com.sun.star.document.TypeDetection"); - aTypeDetection = UnoRuntime.queryInterface(XTypeDetection.class, oObj); - } - catch(com.sun.star.uno.Exception e) - { - GlobalLogWriter.get().println("Can't get com.sun.star.document.TypeDetection."); - return; - } - if (aTypeDetection != null) - { - String sType = aTypeDetection.queryTypeByURL(_sInputURL); - GlobalLogWriter.get().println("Type is: " + sType); - } - } diff --git a/qadevOOo/runner/convwatch/PRNCompare.java b/qadevOOo/runner/convwatch/PRNCompare.java index e7aea95609dc..dc9b9eb2344f 100644 --- a/qadevOOo/runner/convwatch/PRNCompare.java +++ b/qadevOOo/runner/convwatch/PRNCompare.java @@ -39,18 +39,6 @@ public class PRNCompare fs = System.getProperty("file.separator"); } - String executeSynchronously(String _sCommand) - { - ProcessHandler aHandler = new ProcessHandler(_sCommand); - aHandler.executeSynchronously(); - - String sText = aHandler.getOutputText(); - - GlobalLogWriter.get().println("Exitcode: " + String.valueOf(aHandler.getExitCode())); - return sText; - } - - private int getMaxNumOfFileEntry(String _sDirectory, String _sBasename) { // TODO: check if directory exist should be done earlier @@ -140,18 +128,7 @@ public class PRNCompare return aList; } - public StatusHelper[] compare_new() - { - String[] aRefList = createJPEGFromPostscript(m_sOutputPath, m_sReferencePath, m_sReferenceFile, getResolutionInDPI()); -// TODO: Assume, that Postscript is already in the OutputPath, this may change. - String[] aPSList = createJPEGFromPostscript(m_sOutputPath, m_sOutputPath, m_sPostScriptFile, getResolutionInDPI()); - StatusHelper[] aList = createDiffs(aRefList, - aPSList, - getMaxPages(), - m_tUseBorderMove); - return aList; - } private static String getJPEGName(String _sOutputPath, String _sBasename, String _sGS_PageOutput) { diff --git a/qadevOOo/runner/convwatch/PixelCounter.java b/qadevOOo/runner/convwatch/PixelCounter.java index 29c244d57465..240e973e3282 100644 --- a/qadevOOo/runner/convwatch/PixelCounter.java +++ b/qadevOOo/runner/convwatch/PixelCounter.java @@ -75,23 +75,7 @@ class CountNotBlack extends CountPixel class graphics_stuff { - public int stuff() - { -// (1) decoding - int rgba = 0; // ...; // comes from PixelGrabber, BufferedImage.getRGB etc. - int red = (rgba >> 16) & 0xff; - int green = (rgba >> 8) & 0xff; - int blue = rgba & 0xff; - int alpha = (rgba >> 24) & 0xff; -// (2) now modify red, green, blue and alpha as you like; -// make sure that each of the four values stays in the -// interval 0 to 255 -// ... -// (3) and encode back to an int, e.g. to give it to MemoryImageSource or -// BufferedImage.setRGB - rgba = (alpha << 24) | (red << 16) | (green << 8) | blue; - return 0; - } + private static void countPixel(ImageHelper img, int _w, int _h, CountPixel _aPixelCounter) { |