提交 c405c272 编写于 作者: S Serge Rider

Composite status string represetnation fix


Former-commit-id: f517ef26
上级 45347766
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
*/ */
package org.jkiss.dbeaver.model.impl.jdbc.data; package org.jkiss.dbeaver.model.impl.jdbc.data;
import org.jkiss.dbeaver.Log;
import org.jkiss.code.NotNull; import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable; import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.DBUtils; import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.data.DBDValueHandler; import org.jkiss.dbeaver.model.data.DBDValueHandler;
import org.jkiss.dbeaver.model.exec.DBCException; import org.jkiss.dbeaver.model.exec.DBCException;
...@@ -32,7 +32,8 @@ import org.jkiss.utils.CommonUtils; ...@@ -32,7 +32,8 @@ import org.jkiss.utils.CommonUtils;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Struct; import java.sql.Struct;
import java.util.*; import java.util.Arrays;
import java.util.Collection;
/** /**
* Static struct holder. * Static struct holder.
...@@ -46,8 +47,7 @@ public class JDBCCompositeStatic extends JDBCComposite { ...@@ -46,8 +47,7 @@ public class JDBCCompositeStatic extends JDBCComposite {
super(struct, monitor); super(struct, monitor);
} }
public JDBCCompositeStatic(DBCSession session, @NotNull DBSDataType type, @Nullable Struct contents) throws DBCException public JDBCCompositeStatic(DBCSession session, @NotNull DBSDataType type, @Nullable Struct contents) throws DBCException {
{
super(contents); super(contents);
this.type = type; this.type = type;
...@@ -55,7 +55,7 @@ public class JDBCCompositeStatic extends JDBCComposite { ...@@ -55,7 +55,7 @@ public class JDBCCompositeStatic extends JDBCComposite {
try { try {
Object[] attrValues = contents == null ? null : contents.getAttributes(); Object[] attrValues = contents == null ? null : contents.getAttributes();
if (type instanceof DBSEntity) { if (type instanceof DBSEntity) {
DBSEntity entity = (DBSEntity)type; DBSEntity entity = (DBSEntity) type;
Collection<? extends DBSEntityAttribute> entityAttributes = CommonUtils.safeCollection(entity.getAttributes(session.getProgressMonitor())); Collection<? extends DBSEntityAttribute> entityAttributes = CommonUtils.safeCollection(entity.getAttributes(session.getProgressMonitor()));
int valueCount = attrValues == null ? 0 : attrValues.length; int valueCount = attrValues == null ? 0 : attrValues.length;
if (attrValues != null && entityAttributes.size() != valueCount) { if (attrValues != null && entityAttributes.size() != valueCount) {
...@@ -87,9 +87,12 @@ public class JDBCCompositeStatic extends JDBCComposite { ...@@ -87,9 +87,12 @@ public class JDBCCompositeStatic extends JDBCComposite {
} }
@Override @Override
public JDBCCompositeStatic cloneValue(DBRProgressMonitor monitor) throws DBCException public JDBCCompositeStatic cloneValue(DBRProgressMonitor monitor) throws DBCException {
{
return new JDBCCompositeStatic(this, monitor); return new JDBCCompositeStatic(this, monitor);
} }
public String getStringRepresentation() {
return Arrays.toString(values);
}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册