关于Eclipse生成和导入Patch文件.

关于Eclipse生成和导入Patch文件.

&

关于Eclipse生成和导入Patch文件.

生成的文件如下:

关于Eclipse生成和导入Patch文件.

如果系统对这个patch文件有识别的话是一个带有问号的icon文件.

关于Eclipse生成和导入Patch文件.

 diff --git a/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java b/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java
index a5f97fd..8e7cb2f 100644
--- a/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java
+++ b/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java
@@ -73,9 +73,9 @@ public class MetadataEmfFactory {
colType.setComment(metaCol.getComment());
colType.setKey(metaCol.isKey());
colType.setNullable(metaCol.isNullable());
- if (metaCol.getLength() == null) {
- // colType.setLength(-1);
- colType.unsetLength();
+ if (metaCol.getLength() == null || metaCol.getLength().intValue() < 0) {
+ colType.setLength(-1);
+ // colType.unsetLength();
} else {
colType.setLength(metaCol.getLength());
}
@@ -90,9 +90,9 @@ public class MetadataEmfFactory {
} colType.setName(metaCol.getLabel());
- if (metaCol.getPrecision() == null) {
- // colType.setPrecision(-1);
- colType.unsetPrecision();
+ if (metaCol.getPrecision() == null || metaCol.getPrecision().intValue() < 0) {
+ colType.setPrecision(-1);
+ // colType.unsetPrecision();
} else {
colType.setPrecision(metaCol.getPrecision());
}
@@ -144,12 +144,8 @@ public class MetadataEmfFactory {
metaCol.setComment(colType.getComment());
metaCol.setKey(colType.isKey());
metaCol.setNullable(colType.isNullable());
- if (colType.isSetLength()) {
- if (colType.getLength() >= 0) {
- metaCol.setLength(new Integer(colType.getLength()));
- } else {
- metaCol.setLength(null);
- }
+ if (colType.getLength() >= 0) {
+ metaCol.setLength(new Integer(colType.getLength()));
} else {
metaCol.setLength(null);
}
@@ -168,12 +164,8 @@ public class MetadataEmfFactory {
}
}
metaCol.setLabel(colType.getName());
- if (colType.isSetPrecision()) {
- if (colType.getPrecision() >= 0) {
- metaCol.setPrecision(new Integer(colType.getPrecision()));
- } else {
- metaCol.setPrecision(null);
- }
+ if (colType.getPrecision() >= 0) {
+ metaCol.setPrecision(new Integer(colType.getPrecision()));
} else {
metaCol.setPrecision(null);
}
上一篇:CSS 宝典


下一篇:How to append files to a .tar archive using Apache Commons Compress?(转)