Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralexei.trebounskikh2018-09-13 19:58:17 -0400
committeralexei.trebounskikh2018-09-13 19:58:17 -0400
commit8c12584aa0b1666866804006c4cd8100e1553a8e (patch)
treed55508df6881a7bd195399940a55f4bab7ee1453
parentf422548545a931cd4ab2d7d3ba9068607828d902 (diff)
downloadorg.eclipse.mylyn.tasks-8c12584aa0b1666866804006c4cd8100e1553a8e.tar.gz
org.eclipse.mylyn.tasks-8c12584aa0b1666866804006c4cd8100e1553a8e.tar.xz
org.eclipse.mylyn.tasks-8c12584aa0b1666866804006c4cd8100e1553a8e.zip
537208: Task data filename can get too long
* file names with underscores do not need to be encoded Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=537208 Change-Id: I9f8678d101e4a371b5b1c5c0df328a58c829c9df Signed-off-by: alexei.trebounskikh <alexei.trebounskikh@tasktop.com>
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataFileManager.java2
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataFileManagerTest.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataFileManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataFileManager.java
index 3b8fcc7ef..e23efc339 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataFileManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataFileManager.java
@@ -97,7 +97,7 @@ public class TaskDataFileManager {
* @return true or false
*/
private boolean requiresEncoding(String fileName) {
- return !fileName.matches("^[a-zA-Z0-9%\\.]+$"); //$NON-NLS-1$
+ return !fileName.matches("^[_a-zA-Z0-9%\\.]+$"); //$NON-NLS-1$
}
private String trimFilenameIfRequired(String filename) {
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataFileManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataFileManagerTest.java
index 9eb169632..d112027ec 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataFileManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataFileManagerTest.java
@@ -38,6 +38,8 @@ public class TaskDataFileManagerTest extends TestCase {
assertEquals("11111%2520", fileManager.getFileName(TaskTestUtil.createMockTask("11111%20"), true));
// <max, does not exist, not requires encoding == not encoded
assertEquals("11111%20", fileManager.getFileName(TaskTestUtil.createMockTask("11111%20"), false));
+ // <max, does not exist, not requires encoding == not encoded
+ assertEquals("11111%20_", fileManager.getFileName(TaskTestUtil.createMockTask("11111%20_"), false));
// <max, does not exist, requires encoding == encoded
assertEquals("11111%2520%2B", fileManager.getFileName(TaskTestUtil.createMockTask("11111%20+"), false));
// <max, exists, requires encoding == encoded

Back to the top