How can i keep class that extends android.support.v4.app.FragmentActivty? - proguard

How can i keep class that extends FragmentActivty ?
I used -keep public class * extends android.support.v4.app.FragmentActivity
after that the class exists but when i start the application it doesn't work and i have an error that he can't find the class

Related

Sap Spartacus 4.3 extend ProductListComponent

I have this constructor in my class.
export class CustomProductListComponent extends ProductListComponent implements OnInit, OnDestroy {
constructor(
protected pageLayoutService: PageLayoutService,
protected productListComponentService: ProductListComponentService,
protected scrollConfig: ViewConfig,
) {
super(pageLayoutService, productListComponentService, scrollConfig);
}
}
However, it gives me an error of
"Class 'CustomProductListComponent' incorrectly extends base class 'ProductListComponent'.
Property 'pageLayoutService' is private in type 'ProductListComponent' but not in type 'CustomProductListComponent'.ts(2415)
"
Do you know to solve the pageLayoutService since its private in base class?

How to apply #OneToMany on super class getter method in multiple subclasses with different target entity

Stack
I'm using JPA2.0 with Eclipselink 2.6.3 and Spring 4(JTA).
Problem
I'm trying to override the class A attribute with #OneToMany mapping in class B and class C (which is similar to class B ) so that I can change the target entity to class X and Z respectively while fetching results for class B.
Class A has SINGLE_TABLE inheritance and class B & C are discriminator classes which is maintained by #classExtractor depending on some field value in class A.
Class Z has TABLE_PER_CLASS inheritance and class X & Y extends class Z with same table (just a hack for inheritance to avoid DTYPE).
Expected Result
When I query on class B or Class C and fetch getZList() then I should be able to see class X and Y type objects as mentioned in targetEntity in #OneToMany mapping in class B & C
I tried overriding the getter of class A in subclasses like below but the list is always empty.
Class A
#Entity
#Table(name="TABLE_A")
#Customizer(ACustomizer.class)
#Inheritance(strategy=InheritanceType.SINGLE_TABLE)
#ClassExtractor(AExtractor.class)
#InstantiationCopyPolicy
#Cacheable
#Cache( alwaysRefresh=true,
refreshOnlyIfNewer=true,
expiry=300000,
coordinationType = CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES)
public class A implements Serializable {
#Column(name="ABC")
private String abc;
#Transient
private List zlist= new ArrayList<>();
}
Class B
#Entity
public class B extends A{
//problem is here...this mappping doesn't populate super class object
#Access(AccessType.PROPERTY)
#OneToMany(cascade=CascadeType.ALL, mappedBy="class A", targetEntity=Z.class)
#PrivateOwned
public List getZList() {
return super.getZList();
}
}
Class Z
#Entity
#Table(name="TABLE_Z")
#Customizer(ZCustomizer.class)
#Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class Z{
//some fields
//and #oneToOne mapped with class A
}
class X
#Table(name="TABLE_Z")
#Entity
public class X extends Z{
//some fields
}

Kotlin: Visibility of static nested Java class declared inside a non-visible class

Using java my static-nested java class is visible, but using Kotlin it is not. See my example below. Is there a good reason it is not allowed, or is it a bug? And are there any workarounds so that I can extend NestedStaticClass from Kotlin?
I have a package-private java class containing the static-nested class
package javapackage;
class HiddenClass {
public static class NestedStaticClass {}
}
HiddenClass is extended by a public class.
package javapackage;
public class VisibleClass extends HiddenClass{}
From my java class extending VisibleClass, I can see NestedStaticClass (It compiles)
package otherpackage;
import javapackage.VisibleClass;
public class JavaClass extends VisibleClass {
public static class C4 extends NestedStaticClass {}
public JavaClass() {
new NestedStaticClass();
}
}
But from Kotlin this does not work. I get the compile error: "Unresolved reference NestedStaticClass"
package otherpackage
import javapackage.VisibleClass
class KotlinClass() : VisibleClass() {
class C1() : NestedStaticClass()
init {
val v = NestedStaticClass()
}
}

relationship between interface and abstract classes

Can an abstract class inherits from an interface class ?I want to design and implement a class diagram for public transportation system.So i have designed something like this.
1)Limo extends (Abstract)Taxi extends (Interface)Vehicle & (Abstract)public transportation
2)Subway extends (Abstract)public transportation
3)mid-buss extends (Abstract)Buss extends (Abstract)public
transportation & (Interface)Vehicle
4)large-buss extends (Abstract)Buss extends (Abstract)public
transportation & (Interface)Vehicle
So if i want to implement these classes i have to implement the structure of interface's method in the abstract class.what do you think? is it correct to design something like above ?
Can an abstract class inherits from an interface class ?
Yes for Java. The following examples use Java syntax.
Limo extends (Abstract)Taxi extends (Interface)Vehicle & (Abstract)public transportation
public class Limo extends AbstractTaxi{...}
public abstract class AbstractTaxi extends AbstractPublicTransportation implements Vehicle{...}
public interface Vehicle{...}
public abstract class AbstractPublicTransportation{...}
Subway extends (Abstract)public transportation
public class Subway extends AbstractPublicTransportation{...}
mid-buss extends (Abstract)Buss extends (Abstract)public transportation & (Interface)Vehicle
public class MidBuss extends AbstractBuss{...}
public abstract class AbstractBuss extends AbstractPublicTransportation implements Vehicle {...}
large-buss extends (Abstract)Buss extends (Abstract)public transportation & (Interface)Vehicle
public class LargeBuss extends AbstractBuss{...}
Note, that the AbstractTaxi doesn't seem useful yet, because there is only one subclass for that abstract class. However, it's not wrong to introduce additional abstractions to become extensible .

Can we create a Child (with interface MyView extends PopupView) that inherit a PresenterWidget (with interface MyView extends View) (GWTP)?

In GWTP, is there any way that we can create a Child (that has "interface MyView extends PopupView") that inherit a PresenterWidget (that has "interface MyView extends View")?
Here is my problem. I have a need to prompt (in a form of PopupView) user to enter shipping address if they didn't have one.
Of course, there is a UserShippingAddressPresenter presenter widget that is not a popup & locates in profile page.
public class UserShippingAddressPresenter extends
PresenterWidget<UserShippingAddressPresenter.MyView> {
public interface MyView extends View {
////...... more code///
}
}
Now I want to have a PopupUserShippingAddressPresenter that has exactly Gui & functionality like the UserShippingAddressPresenter, but it is a Popup like this
public class UserShippingAddressPopupPresenter extends
PresenterWidget<UserShippingAddressPresenter.MyView> {
public interface MyView extends PopupView {
////...... more code///
}
}
So This is the logic that i think it works but it didn't. That is I will use eclipse to create UserShippingAddressPopupPresenter with interface MyView extends PopupView then in UserShippingAddressPopupView I tried to setInSlot userShiopingAddress like the following
public class UserShippingAddressPopupView extends PopupViewImpl implements
UserShippingAddressPopupPresenter.MyView {
#Override
public void setInSlot(Object slot, Widget content){
if(slot==ProfilePresenter.SLOT_userShippingAddress){
userShippingAddressHTMLPanel.clear();
if(content!=null){
userShippingAddressHTMLPanel.add(content);
}
}
else{
super.setInSlot(slot, content);
}
}
}
in UserShippingAddressPopupPresenter
public class UserShippingAddressPopupPresenter extends
PresenterWidget<UserShippingAddressPopupPresenter.MyView> {
public static final Object SLOT_userShippingAddress=new Object();
public interface MyView extends PopupView {}
#Inject UserShippingAddressPresenter userShippingAddressPresenter;
#Override
protected void onReveal() {
super.onReveal();
setInSlot( SLOT_userShippingAddress, userShippingAddressPresenter);
}
}
After running, it showed a very small box in the middle of the page.
I tried onReset instead of onReveal but it didn't work either.
Can u find a better solution?
My logic is ok, it's working. I fixed it, the problem is that "if(slot==ProfilePresenter.SLOT_userShippingAddress){" is wrong, correct should be "if(slot==PopupUserShippingAddressPresenter.SLOT_userShippingAddress){"