private long[] _getLeftAndRightCategoryIds(long[] categoryIds) { long[] leftRightIds = new long[categoryIds.length * 3]; for (int i = 0; i < categoryIds.length; i++) { long categoryId = categoryIds[i]; try { AssetCategory category = AssetCategoryLocalServiceUtil.getCategory(categoryId); leftRightIds[3 * i] = category.getGroupId(); leftRightIds[3 * i + 1] = category.getLeftCategoryId(); leftRightIds[3 * i + 2] = category.getRightCategoryId(); } catch (Exception e) { if (_log.isWarnEnabled()) { _log.warn("Error retrieving category " + categoryId); } } } return leftRightIds; }