<commit_before>/*
 *
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

package flex2.compiler.config;

import java.io.File;
import java.lang.reflect.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

/**
 * Flex MXMLC compiler uses the result of the client configuration parser
 * to generate mixin initialization source code to be added to the SWF by
 * PreLink. It also requires a list of channel classes to be added as
 * dependencies.
 *
 * @exclude
 */
public class ServicesDependenciesWrapper
{
	private Object servicesDependenciesInstance;
	private Class servicesDependenciesClass;
	
    public ServicesDependenciesWrapper(String path, String parserClass, String contextRoot)
    {
    	try 
    	{
    		servicesDependenciesClass = Class.forName("flex.messaging.config.ServicesDependencies");
    	}
    	catch (ClassNotFoundException e)
    	{
    		return;
    	}
		Class partypes[] = new Class[3];
        partypes[0] = String.class;
        partypes[1] = String.class;
        partypes[2] = String.class;
        try
        {
            Constructor ct = servicesDependenciesClass.getConstructor(partypes);        	
            Object arglist[] = new Object[3];
            arglist[0] = path;
            arglist[1] = parserClass;
            arglist[2] = contextRoot;
            try 
            {
                servicesDependenciesInstance = ct.newInstance(arglist);            	
            }
            catch (Throwable e3)
            {
            	System.err.println(e3);
            }
        }
        catch (NoSuchMethodException e2)
        {
        	
        }
    }

    public Set getLazyAssociations(String destination)
    {
    	if (servicesDependenciesClass != null)
    	{
    		try
    		{
    			Method method = servicesDependenciesClass.getMethod("getLazyAssociations", new Class[] {String.class});
    			Object arglist[] = new Object[1];
                arglist[0] = destination;
                return (Set)method.invoke(servicesDependenciesInstance, arglist);   			
    		}
    		catch (Throwable e)
    		{
    			
    		}
    	}
    	
    	return null;
    }
<commit_msg>attempt to show better error when problem with services-config.xml<commit_after>/*
 *
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

package flex2.compiler.config;

import java.io.File;
import java.lang.reflect.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

/**
 * Flex MXMLC compiler uses the result of the client configuration parser
 * to generate mixin initialization source code to be added to the SWF by
 * PreLink. It also requires a list of channel classes to be added as
 * dependencies.
 *
 * @exclude
 */
public class ServicesDependenciesWrapper
{
	private Object servicesDependenciesInstance;
	private Class servicesDependenciesClass;
	
    public ServicesDependenciesWrapper(String path, String parserClass, String contextRoot)
    {
    	try 
    	{
    		servicesDependenciesClass = Class.forName("flex.messaging.config.ServicesDependencies");
    	}
    	catch (ClassNotFoundException e)
    	{
    		return;
    	}
		Class partypes[] = new Class[3];
        partypes[0] = String.class;
        partypes[1] = String.class;
        partypes[2] = String.class;
        try
        {
            Constructor ct = servicesDependenciesClass.getConstructor(partypes);        	
            Object arglist[] = new Object[3];
            arglist[0] = path;
            arglist[1] = parserClass;
            arglist[2] = contextRoot;
            try 
            {
                servicesDependenciesInstance = ct.newInstance(arglist);            	
            }
            catch (Throwable e3)
            {
            	if (e3 instanceof InvocationTargetException)
            		System.err.println(((InvocationTargetException)e3).getCause());
            	else
            		System.err.println(e3);
            }
        }
        catch (NoSuchMethodException e2)
        {
        	
        }
    }

    public Set getLazyAssociations(String destination)
    {
    	if (servicesDependenciesClass != null)
    	{
    		try
    		{
    			Method method = servicesDependenciesClass.getMethod("getLazyAssociations", new Class[] {String.class});
    			Object arglist[] = new Object[1];
                arglist[0] = destination;
                return (Set)method.invoke(servicesDependenciesInstance, arglist);   			
    		}
    		catch (Throwable e)
    		{
    			
    		}
    	}
    	
    	return null;
    }

{'fraction_non_alphanumeric': 0.07838098297462255, 'fraction_numerical': 0.006103437198843559, 'mean_word_length': 2.412054794520548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5015429', 'n_tokens_mistral': 1729, 'n_tokens_neox': 1679, 'n_words': 528}