Subversion Repository Public Repository

litesoft

Diff Revisions 150 vs 151 for /trunk/Java/core/Server/src/org/litesoft/orsup/otherattributeaccessors/AbstractAttributeAccessorSCDtoPO.java

Diff revisions: vs.
  @@ -6,8 +6,7 @@
6 6 import org.litesoft.orsup.lazyload.*;
7 7 import org.litesoft.orsup.nonpublic.*;
8 8
9 - public abstract class AbstractAttributeAccessorSCDtoPO<Owner extends PersistentObjectImpl, Them extends PersistentObjectImpl>
10 - extends AttributeAccessorSCD<Owner>
9 + public abstract class AbstractAttributeAccessorSCDtoPO<Owner extends PersistentObjectImpl, Them extends PersistentObjectImpl> extends AttributeAccessorSCD<Owner>
11 10 {
12 11 private String mToThemName;
13 12 private String mBackReference;
  @@ -67,8 +66,7 @@
67 66 {
68 67 PO_URLstringHelper zHelper = (PO_URLstringHelper) pObject;
69 68 String zRegistrationName = zHelper.getPersistedObjectRegistrationName();
70 - PersistentObjectUniqueKey zPOUK = pPO.getFinder().createPersistentObjectUniqueKeyFrom(
71 - zRegistrationName, zHelper.getPersistentObjectUniqueKey() );
69 + PersistentObjectUniqueKey zPOUK = pPO.getFinder().createPersistentObjectUniqueKeyFrom( zRegistrationName, zHelper.getPersistentObjectUniqueKey() );
72 70 pObject = new PersistentObjectURL( zRegistrationName, zPOUK );
73 71 }
74 72 if ( pObject instanceof ObjectHandle )
  @@ -81,16 +79,14 @@
81 79 }
82 80 else if ( pObject instanceof PersistentObjectUniqueKey )
83 81 {
84 - pObject = noNull( pObject, pPO.getFinder().findOne( pPersistentObjectClass,
85 - (PersistentObjectUniqueKey) pObject ) );
82 + pObject = noNull( pObject, pPO.getFinder().findOne( pPersistentObjectClass, (PersistentObjectUniqueKey) pObject ) );
86 83 }
87 84 if ( pPersistentObjectClass.isInstance( pObject ) )
88 85 {
89 86 //noinspection unchecked
90 87 return (Them) pObject;
91 88 }
92 - throw new IllegalArgumentException( "Unable to convert '" + pObject + "' of type '" +
93 - pObject.getClass() + "' to a type: " + pPersistentObjectClass );
89 + throw new IllegalArgumentException( "Unable to convert '" + pObject + "' of type '" + pObject.getClass() + "' to a type: " + pPersistentObjectClass );
94 90 }
95 91
96 92 public Them to_PO( Owner pPO, String className, Object pObject )
  @@ -103,8 +99,7 @@
103 99 {
104 100 PO_URLstringHelper zHelper = (PO_URLstringHelper) pObject;
105 101 String zRegistrationName = zHelper.getPersistedObjectRegistrationName();
106 - PersistentObjectUniqueKey zPOUK = pPO.getFinder().createPersistentObjectUniqueKeyFrom(
107 - zRegistrationName, zHelper.getPersistentObjectUniqueKey() );
102 + PersistentObjectUniqueKey zPOUK = pPO.getFinder().createPersistentObjectUniqueKeyFrom( zRegistrationName, zHelper.getPersistentObjectUniqueKey() );
108 103 pObject = new PersistentObjectURL( zRegistrationName, zPOUK );
109 104 }
110 105 if ( pObject instanceof ObjectHandle )
  @@ -117,8 +112,7 @@
117 112 }
118 113 else if ( pObject instanceof PersistentObjectUniqueKey )
119 114 {
120 - pObject = noNull( pObject,
121 - pPO.getFinder().findOne( className, (PersistentObjectUniqueKey) pObject ) );
115 + pObject = noNull( pObject, pPO.getFinder().findOne( className, (PersistentObjectUniqueKey) pObject ) );
122 116 }
123 117
124 118 String name;
  @@ -137,8 +131,7 @@
137 131 //noinspection unchecked,ConstantConditions
138 132 return (Them) pObject;
139 133 }
140 - throw new IllegalArgumentException( "Unable to convert '" + pObject + "' of type '" +
141 - pObject.getClass() + "' to a type: " + className );
134 + throw new IllegalArgumentException( "Unable to convert '" + pObject + "' of type '" + pObject.getClass() + "' to a type: " + className );
142 135 }
143 136
144 137 private Object noNull( Object pSearchWith, Object pFound )
  @@ -147,7 +140,6 @@
147 140 {
148 141 return pFound;
149 142 }
150 - throw new IllegalArgumentException(
151 - "Unable to locate PO with '" + pSearchWith + "' of type '" + pSearchWith.getClass() + "'" );
143 + throw new IllegalArgumentException( "Unable to locate PO with '" + pSearchWith + "' of type '" + pSearchWith.getClass() + "'" );
152 144 }
153 145 }