You are on page 1of 1

REFACTORING

1. Infer Generic Type Arguments

- Replaces raw type occurrences of generic types by parameterized types after identifying all
places where this replacement is possible.
-

public void process(final ServiceRequest request, final ServiceResponse


response)
throws ParameterizedException
{
try
{
final ItemDataServiceRequest currentRequest =
(ItemDataServiceRequest)request;
final ItemDataServiceResponse currentResponse =
(ItemDataServiceResponse)response;

final Item currentItem = currentRequest.getCurrentItem();

if (LOG.isDebugEnabled())
{
LOG.debug("Processing : Input Request DTO is : " + request);
}

final List outputList = new ArrayList();

outputList.add(currentItem);

((ItemsMgmtDAO)getCurrentDAO()).createItem(currentItem);

currentResponse.setDataItemsList(outputList);

// Set the status message as successful.

request.setStatusMessage(CommonUtils.getLocalizedProperty(CommonUtils.SUCCESS
_MSG));
}
catch (final Exception currentEx)
{
throw new ParameterizedException(currentEx.getMessage(),
currentEx);
}
}

You might also like