Non-serializable service references | Adobe Higher Education
Skip to main content
March 18, 2021
질문

Non-serializable service references

  • March 18, 2021
  • 1 답변
  • 1009 조회

Hi, we recently started using the Cloud Manager pipelines to run analysis on our code and one of the critical code smells that keep popping up is the following:

 

IssueTypeSeverityEffortRuleTagsDocumentation
Make "cryptoSupport" transient or serializable.Code SmellCritical30minsquid:S1948cwe,serializationhttps://www.adobe.com/go/aem_cmcq_s1948_en

 

In this case "cryptoSupport" refers to an injected service that implements the com.adobe.granite.crypto.CryptoSupport interface.

 

@3214626
private CryptoSupport cryptoSupport;

 

My question is: Since we can't make CryptoSupport serializable, is it safe to declare the field as transient? Is there any danger of our servlet (that contains the above service reference) being flushed to disk at some point and failing to restore the service reference later?

 

Thank you,

William.

이 주제는 답변이 닫혔습니다.

1 답변

ChetanyaJain-1
Community Advisor
Community Advisor
December 3, 2022