diff --git a/pom.xml b/pom.xml index 456735d8..d163ed7d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.force dataloader jar - 46.0.0 + 46.1.0 Data Loader https://github.com/forcedotcom/dataloader @@ -98,12 +98,6 @@ 1.4.197 test - - - commons-beanutils - commons-beanutils - 1.7.0 - commons-dbcp commons-dbcp @@ -114,14 +108,12 @@ commons-io 2.6 - junit junit 4.13-beta-1 test - log4j log4j @@ -132,7 +124,6 @@ httpclient 4.5.6 - org.eclipse core.commands diff --git a/release/mac/dataloader.command b/release/mac/dataloader.command index 2b61c3ce..d72054ce 100755 --- a/release/mac/dataloader.command +++ b/release/mac/dataloader.command @@ -26,5 +26,5 @@ then else echo "$JAVA_HOME" cd DATALODER_WORK_DIRECTORY_PLACEHOLDER #change to your own customized directory - java -XstartOnFirstThread -jar dataloader-46.0.0-uber.jar salesforce.config.dir=DATALODER_WORK_DIRECTORY_PLACEHOLDER/configs + java -XstartOnFirstThread -jar dataloader-46.1.0-uber.jar salesforce.config.dir=DATALODER_WORK_DIRECTORY_PLACEHOLDER/configs fi diff --git a/release/mac/install.command b/release/mac/install.command index 0a0728ed..48ef4089 100755 --- a/release/mac/install.command +++ b/release/mac/install.command @@ -1,7 +1,7 @@ #!/bin/bash -DATALOADER_VERSION="46.0.0" +DATALOADER_VERSION="46.1.0" DATALOADER_SHORT_VERSION="46" -DATALOADER_UBER_JAR_NAME="dataloader-46.0.0-uber.jar" +DATALOADER_UBER_JAR_NAME="dataloader-46.1.0-uber.jar" echo "" echo "*************************************************************************" diff --git a/release/win/bin/encrypt.bat b/release/win/bin/encrypt.bat index 25e12b87..fac7b927 100644 --- a/release/win/bin/encrypt.bat +++ b/release/win/bin/encrypt.bat @@ -6,8 +6,11 @@ IF "%JAVA_HOME%" == "" ( IF NOT EXIST "%JAVA_HOME%" ( echo We couldn't find the Java Runtime Environment ^(JRE^) in directory "%JAVA_HOME%". To run process.bat, set the JAVA_HOME environment variable to the directory where the JRE is installed. ) ELSE ( - "%JAVA_HOME%\bin\java" -cp ..\dataloader-46.0.0-uber.jar com.salesforce.dataloader.security.EncryptionUtil %* + "%JAVA_HOME%\bin\java" -cp ..\dataloader-46.1.0-uber.jar com.salesforce.dataloader.security.EncryptionUtil %* ) ) + + + diff --git a/release/win/bin/process.bat b/release/win/bin/process.bat index 0ba47d89..1a536d14 100644 --- a/release/win/bin/process.bat +++ b/release/win/bin/process.bat @@ -26,7 +26,7 @@ if not [%2]==[] set PROCESS_OPTION=process.name=%2 IF "%JAVA_HOME%" == "" ( - for /f "tokens=*" %%i in ('dataloader-46.0.0-java-home.exe') do ( + for /f "tokens=*" %%i in ('dataloader-46.1.0-java-home.exe') do ( IF EXIST "%%i" ( set JAVA_HOME=%%i ) ELSE ( @@ -41,7 +41,7 @@ IF "%JAVA_HOME%" == "" ( IF NOT EXIST "%JAVA_HOME%" ( echo We couldn't find the Java Runtime Environment ^(JRE^) in directory "%JAVA_HOME%". To run process.bat, set the JAVA_HOME environment variable to the directory where the JRE is installed. ) ELSE ( - "%JAVA_HOME%\bin\java" -cp ..\dataloader-46.0.0-uber.jar -Dsalesforce.config.dir=%1 com.salesforce.dataloader.process.ProcessRunner %PROCESS_OPTION% + "%JAVA_HOME%\bin\java" -cp ..\dataloader-46.1.0-uber.jar -Dsalesforce.config.dir=%1 com.salesforce.dataloader.process.ProcessRunner %PROCESS_OPTION% ) ) diff --git a/release/win/dataloader.bat b/release/win/dataloader.bat index 201a776a..8294a91a 100755 --- a/release/win/dataloader.bat +++ b/release/win/dataloader.bat @@ -31,7 +31,7 @@ echo. ) :Run - "%ZULU_JAVA_HOME%\bin\java" -jar dataloader-46.0.0-uber.jar salesforce.config.dir=configs + "%ZULU_JAVA_HOME%\bin\java" -jar dataloader-46.1.0-uber.jar salesforce.config.dir=configs :Exit endlocal diff --git a/release/win/install.bat b/release/win/install.bat index 52e87278..557a072b 100755 --- a/release/win/install.bat +++ b/release/win/install.bat @@ -1,9 +1,9 @@ @echo off setlocal -set DATALOADER_VERSION=46.0.0 +set DATALOADER_VERSION=46.1.0 set DATALOADER_SHORT_VERSION=46 -set DATALOADER_UBER_JAR_NAME=dataloader-46.0.0-uber.jar +set DATALOADER_UBER_JAR_NAME=dataloader-46.1.0-uber.jar echo. echo ************************************************************************* diff --git a/src/main/java/com/salesforce/dataloader/client/PartnerClient.java b/src/main/java/com/salesforce/dataloader/client/PartnerClient.java index 920095d3..c6bb17fe 100644 --- a/src/main/java/com/salesforce/dataloader/client/PartnerClient.java +++ b/src/main/java/com/salesforce/dataloader/client/PartnerClient.java @@ -447,7 +447,7 @@ private void processResult(boolean success, String successMsgKey, String id, Err startRow = 0; } logger.error(Messages.getString("Client.itemError") //$NON-NLS-1$ - + new Integer((itemNbr + startRow)).toString()); + + Integer.valueOf(itemNbr + startRow).toString()); logger.error(Messages.getString("Client.errorCode") + err.getStatusCode().toString()); //$NON-NLS-1$ logger.error(Messages.getString("Client.errorMessage") + err.getMessage()); //$NON-NLS-1$ } diff --git a/src/main/java/com/salesforce/dataloader/config/Config.java b/src/main/java/com/salesforce/dataloader/config/Config.java index 186b7b63..5841b6af 100644 --- a/src/main/java/com/salesforce/dataloader/config/Config.java +++ b/src/main/java/com/salesforce/dataloader/config/Config.java @@ -388,7 +388,7 @@ public double getDouble(String name) throws ParameterLoadException { if (value == null || value.length() == 0) return DOUBLE_DEFAULT; double ival; try { - ival = new Double(value).doubleValue(); + ival = Double.parseDouble(value); } catch (NumberFormatException e) { String errMsg = Messages.getFormattedString("Config.errorParameterLoad", new String[]{name, Double.class.getName()}); @@ -408,7 +408,7 @@ public float getFloat(String name) throws ParameterLoadException { if (value == null || value.length() == 0) return FLOAT_DEFAULT; float ival = FLOAT_DEFAULT; try { - ival = new Float(value).floatValue(); + ival = Float.parseFloat(value); } catch (NumberFormatException e) { String errMsg = Messages.getFormattedString("Config.errorParameterLoad", new String[]{name, Float.class.getName()}); diff --git a/src/main/java/com/salesforce/dataloader/dyna/DoubleConverter.java b/src/main/java/com/salesforce/dataloader/dyna/DoubleConverter.java index 7ca20d88..56566558 100644 --- a/src/main/java/com/salesforce/dataloader/dyna/DoubleConverter.java +++ b/src/main/java/com/salesforce/dataloader/dyna/DoubleConverter.java @@ -84,10 +84,10 @@ public Object convert(Class type, Object value) { } if (value instanceof Double) { return (value); - } else if (value instanceof Number) { return new Double(((Number)value).doubleValue()); } + } else if (value instanceof Number) { return ((Number) value).doubleValue(); } try { - return (new Double(value.toString())); + return (Double.valueOf(value.toString())); } catch (Exception e) { if (useDefault) { return (defaultValue); diff --git a/src/main/java/com/salesforce/dataloader/dyna/IntegerConverter.java b/src/main/java/com/salesforce/dataloader/dyna/IntegerConverter.java index 4af5dbd5..29f92a25 100644 --- a/src/main/java/com/salesforce/dataloader/dyna/IntegerConverter.java +++ b/src/main/java/com/salesforce/dataloader/dyna/IntegerConverter.java @@ -85,11 +85,11 @@ public Object convert(Class type, Object value) { if (value instanceof Integer) { return (value); } else if (value instanceof Number) { - return new Integer(((Number)value).intValue()); + return Integer.valueOf(((Number)value).intValue()); } try { - return (new Integer(value.toString())); + return (Integer.parseInt(value.toString())); } catch (Exception e) { if (useDefault) { return (defaultValue); diff --git a/src/main/java/com/salesforce/dataloader/dyna/SforceDynaBean.java b/src/main/java/com/salesforce/dataloader/dyna/SforceDynaBean.java index 4551898d..469ff335 100644 --- a/src/main/java/com/salesforce/dataloader/dyna/SforceDynaBean.java +++ b/src/main/java/com/salesforce/dataloader/dyna/SforceDynaBean.java @@ -287,12 +287,12 @@ static public SObject[] getSObjectArray(Controller controller, List dy public static SObject getSObject(Controller controller, String entityName, DynaBean dynaBean) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException, ParameterLoadException { SObject sObj = new SObject(); sObj.setType(entityName); - Map fieldMap = BeanUtils.describe(dynaBean); + Map fieldMap = BeanUtils.describe(dynaBean); for (String fName : fieldMap.keySet()) { if (fieldMap.get(fName) != null) { // see if any entity foreign key references are embedded here Object value = dynaBean.get(fName); - if (value != null && value instanceof SObjectReference) { + if (value instanceof SObjectReference) { SObjectReference sObjRef = (SObjectReference)value; if (!sObjRef.isNull()) sObjRef.addReferenceToSObject(controller, sObj, fName); } else { diff --git a/src/main/java/com/salesforce/dataloader/security/EncryptionUtil.java b/src/main/java/com/salesforce/dataloader/security/EncryptionUtil.java index 54bbc8c7..911f8e64 100644 --- a/src/main/java/com/salesforce/dataloader/security/EncryptionUtil.java +++ b/src/main/java/com/salesforce/dataloader/security/EncryptionUtil.java @@ -43,7 +43,7 @@ public static byte[] textToBytes(String text) { { tmpValue = (tmpValue - 127) * -1; } - tmpInteger = new Integer(tmpValue); + tmpInteger = Integer.valueOf(tmpValue); baBytes[j] = tmpInteger.byteValue(); } diff --git a/src/main/java/com/salesforce/dataloader/ui/LoaderWizardDialog.java b/src/main/java/com/salesforce/dataloader/ui/LoaderWizardDialog.java index eec202f6..ba314148 100644 --- a/src/main/java/com/salesforce/dataloader/ui/LoaderWizardDialog.java +++ b/src/main/java/com/salesforce/dataloader/ui/LoaderWizardDialog.java @@ -430,7 +430,7 @@ private Button createCancelButton(Composite parent) { button.setText(IDialogConstants.CANCEL_LABEL); setButtonLayoutData(button); button.setFont(parent.getFont()); - button.setData(new Integer(IDialogConstants.CANCEL_ID)); + button.setData(Integer.valueOf(IDialogConstants.CANCEL_ID)); button.addSelectionListener(cancelListener); return button; } @@ -445,7 +445,7 @@ private Button createCancelButton(Composite parent) { @Override protected Button getButton(int id) { if (id == IDialogConstants.CANCEL_ID) return cancelButton; - return buttons.get(new Integer(id)); + return buttons.get(Integer.valueOf(id)); } /** @@ -827,7 +827,7 @@ public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable */ private void saveEnableStateAndSet(Control w, Map h, String key, boolean enabled) { if (w != null) { - h.put(key, new Boolean(w.getEnabled())); + h.put(key, Boolean.valueOf(w.getEnabled())); w.setEnabled(enabled); } } @@ -1246,7 +1246,7 @@ protected Button createButton(Composite parent, int id, String label,boolean def Button button = new Button(parent, SWT.PUSH | SWT.FLAT); button.setText(label); button.setFont(JFaceResources.getDialogFont()); - button.setData(new Integer(id)); + button.setData(Integer.valueOf(id)); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { buttonPressed(((Integer) event.widget.getData()).intValue()); @@ -1259,7 +1259,7 @@ public void widgetSelected(SelectionEvent event) { } } - buttons.put(new Integer(id), button); + buttons.put(Integer.valueOf(id), button); setButtonLayoutData(button); return button; diff --git a/src/main/java/com/salesforce/dataloader/ui/OAuthTokenFlow.java b/src/main/java/com/salesforce/dataloader/ui/OAuthTokenFlow.java index 857c386c..dc97bad0 100644 --- a/src/main/java/com/salesforce/dataloader/ui/OAuthTokenFlow.java +++ b/src/main/java/com/salesforce/dataloader/ui/OAuthTokenFlow.java @@ -119,7 +119,7 @@ public static boolean handleCompletedUrl(String url, Config config) throws URISy if (params.containsKey("issued_at")) { String issued_at = params.get("issued_at"); if (issued_at != null && !issued_at.equals("")) { - token.setIssuedAt(new Long(issued_at)); + token.setIssuedAt(Long.valueOf(issued_at)); } } diff --git a/src/test/java/com/salesforce/dataloader/EncryptionUtil/EncryptionUtilTest.java b/src/test/java/com/salesforce/dataloader/EncryptionUtil/EncryptionUtilTest.java index b5000189..2f91f328 100644 --- a/src/test/java/com/salesforce/dataloader/EncryptionUtil/EncryptionUtilTest.java +++ b/src/test/java/com/salesforce/dataloader/EncryptionUtil/EncryptionUtilTest.java @@ -101,27 +101,32 @@ public void testGetFilePath() throws IOException, GeneralSecurityException { @Test public void testAutoSetKeyFile() throws IOException, GeneralSecurityException { - EncryptionAesUtil encryptionAesUtil = new EncryptionAesUtil(); - String passwordText = "somePassword6c3708b3"; - String filePath = encryptionAesUtil.createUserProfileKeyName(); - String filePathBak = filePath + ".bak"; - Boolean cleanup = false; - if (Files.exists(Paths.get(filePath))) { - cleanup = true; - Files.move(Paths.get(filePath), Paths.get(filePathBak)); + boolean cleanup = false; + String filePath = null; + String filePathBak = null; + try { + EncryptionAesUtil encryptionAesUtil = new EncryptionAesUtil(); + String passwordText = "somePassword6c3708b3"; + filePath = encryptionAesUtil.createUserProfileKeyName(); + filePathBak = filePath + ".bak"; + if (Files.exists(Paths.get(filePath))) { + cleanup = true; + Files.move(Paths.get(filePath), Paths.get(filePathBak)); + } + // without setting the default key + String encryptedMsg = encryptionAesUtil.encryptMsg(passwordText); + String decryptedMsg = encryptionAesUtil.decryptMsg(encryptedMsg); + + Assert.assertTrue(Files.exists(Paths.get(filePath))); + Files.delete(Paths.get(filePath)); + + logger.info("\nEncrypted message:" + encryptedMsg.toString() + "\nText to be encrypted:" + passwordText + "\nDecrypted text:" + decryptedMsg); + Assert.assertNotEquals("Encrypted message should be not be equal to original message", passwordText, encryptedMsg); + Assert.assertEquals("Text recovered from encrypted message is as the expected: ", passwordText, decryptedMsg); + } finally { + if (cleanup) { + Files.move(Paths.get(filePathBak), Paths.get(filePath)); + } } - // without setting the default key - String encryptedMsg = encryptionAesUtil.encryptMsg(passwordText); - String decryptedMsg = encryptionAesUtil.decryptMsg(encryptedMsg); - - Assert.assertTrue(Files.exists(Paths.get(filePath))); - Files.delete(Paths.get(filePath)); - if (cleanup) { - Files.move(Paths.get(filePathBak), Paths.get(filePath)); - } - - logger.info("\nEncrypted message:" + encryptedMsg.toString() + "\nText to be encrypted:" + passwordText + "\nDecrypted text:" + decryptedMsg); - Assert.assertNotEquals("Encrpted message should be not be equal to original message", passwordText, new String(encryptedMsg)); - Assert.assertEquals("Text recovered from encrypted message is as the expected: ", passwordText, decryptedMsg); } }