&
生成的文件如下:
如果系统对这个patch文件有识别的话是一个带有问号的icon文件.
1 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 2 index a5f97fd..8e7cb2f 100644 3 --- a/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java 4 +++ b/main/plugins/org.talend.designer.core/src/main/java/org/talend/designer/core/model/metadata/MetadataEmfFactory.java 5 @@ -73,9 +73,9 @@ public class MetadataEmfFactory { 6 colType.setComment(metaCol.getComment()); 7 colType.setKey(metaCol.isKey()); 8 colType.setNullable(metaCol.isNullable()); 9 - if (metaCol.getLength() == null) { 10 - // colType.setLength(-1); 11 - colType.unsetLength(); 12 + if (metaCol.getLength() == null || metaCol.getLength().intValue() < 0) { 13 + colType.setLength(-1); 14 + // colType.unsetLength(); 15 } else { 16 colType.setLength(metaCol.getLength()); 17 } 18 @@ -90,9 +90,9 @@ public class MetadataEmfFactory { 19 } 20 21 colType.setName(metaCol.getLabel()); 22 - if (metaCol.getPrecision() == null) { 23 - // colType.setPrecision(-1); 24 - colType.unsetPrecision(); 25 + if (metaCol.getPrecision() == null || metaCol.getPrecision().intValue() < 0) { 26 + colType.setPrecision(-1); 27 + // colType.unsetPrecision(); 28 } else { 29 colType.setPrecision(metaCol.getPrecision()); 30 } 31 @@ -144,12 +144,8 @@ public class MetadataEmfFactory { 32 metaCol.setComment(colType.getComment()); 33 metaCol.setKey(colType.isKey()); 34 metaCol.setNullable(colType.isNullable()); 35 - if (colType.isSetLength()) { 36 - if (colType.getLength() >= 0) { 37 - metaCol.setLength(new Integer(colType.getLength())); 38 - } else { 39 - metaCol.setLength(null); 40 - } 41 + if (colType.getLength() >= 0) { 42 + metaCol.setLength(new Integer(colType.getLength())); 43 } else { 44 metaCol.setLength(null); 45 } 46 @@ -168,12 +164,8 @@ public class MetadataEmfFactory { 47 } 48 } 49 metaCol.setLabel(colType.getName()); 50 - if (colType.isSetPrecision()) { 51 - if (colType.getPrecision() >= 0) { 52 - metaCol.setPrecision(new Integer(colType.getPrecision())); 53 - } else { 54 - metaCol.setPrecision(null); 55 - } 56 + if (colType.getPrecision() >= 0) { 57 + metaCol.setPrecision(new Integer(colType.getPrecision())); 58 } else { 59 metaCol.setPrecision(null); 60 }
本文转自SummerChill博客园博客,原文链接:http://www.cnblogs.com/DreamDrive/p/4694200.html,如需转载请自行联系原作者