Buggy code:
@ SuppressWarnings ( "restriction" ) public class LiferayTomcatUtil { public static void displayToggleMessage ( String msg , String key ) { } public static IPath [ ] getAllUserClasspathLibraries ( IPath runtimeLocation , IPath portalDir ) { } public static Properties getCategories ( IPath runtimeLocation , IPath portalDir ) { } public static ILiferayTomcatRuntime getLiferayTomcatRuntime ( IRuntime runtime ) { } public static IPath getPortalDir ( IPath appServerDir ) { } public static String [ ] getSupportedHookProperties ( IPath runtimeLocation , IPath portalDir ) throws IOException { } public static String getVersion ( IPath location , IPath portalDir ) throws IOException { } public static boolean isExtProjectContext ( Context context ) { } public static boolean isLiferayModule ( IModule module ) { } public static Context loadContextFile ( File contextFile ) { } public static void loadHookPropertiesFile ( IPath runtimeLocation , IPath portalDir , File hookPropertiesFile , File errorFile ) throws IOException { } public static void loadVersionInfoFile ( IPath runtimeLocation , IPath portalDir , File versionInfoFile , File errorFile ) throws IOException { } public static IPath modifyLocationForBundle ( IPath currentLocation ) { } public static void syncStopServer ( final IServer server ) { } public static IStatus validateRuntimeStubLocation ( IPath runtimeStubLocation ) { } public static IStatus canAddModule ( IModule module , IServer currentServer ) { } public static void addRuntimeVMArgments ( List < String > runtimeVMArgs , IPath installPath , IPath configPath , IPath deployPath , boolean isTestEnv , IServer currentServer , ILiferayTomcatServer liferayTomcatServer ) { } private static void addUserVMArgs ( List < String > runtimeVMArgs , IServer currentServer , ILiferayTomcatServer portalTomcatServer ) { } private static File getExternalPropertiesFile ( IPath installPath , IPath configPath , IServer currentServer , ILiferayTomcatServer portalServer ) { } private static File setupExternalPropertiesFile ( File portalIdePropFile , String externalPropertiesPath ) { } private static File ensurePortalIDEPropertiesExists ( IPath installPath , IPath configPath , IServer currentServer , ILiferayTomcatServer portalServer ) { } <START_BUG> public static String [ ] getServletFilterNames ( IPath runtimeLocation , IPath portalDir ) throws Exception { <END_BUG> List < String > retval = new ArrayList < String > ( ) ; File filtersWebXmlFile = portalDir . append ( "WEB-INF//liferay-web.xml" ) . toFile ( ) ; if ( ! ( filtersWebXmlFile . exists ( ) ) ) { filtersWebXmlFile = portalDir . append ( "WEB-INF//web.xml" ) . toFile ( ) ; } if ( filtersWebXmlFile . exists ( ) ) { Document document = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) . parse ( filtersWebXmlFile ) ; NodeList filterNameElements = document . getElementsByTagName ( "filter-name" ) ; for ( int i = 0 ; i < ( filterNameElements . getLength ( ) ) ; i ++ ) { Node filterNameElement = filterNameElements . item ( i ) ; String content = filterNameElement . getTextContent ( ) ; if ( ! ( CoreUtil . isNullOrEmpty ( content ) ) ) { retval . add ( content . trim ( ) ) ; } } } return retval . toArray ( new String [ 0 ] ) ; } }

Fix:
public static String [ ] getServletFilterNames ( IPath portalDir ) throws Exception {