Projects >> jmeter >>5156523df46bfcfe110bbdf4afbd0131772fdc91

Chunk
Conflicting content
		}
		try {
			String delim = getDelimiter();
<<<<<<< HEAD
			if (delim.equals("\\t"))
				delim = "\t";// Make it easier to enter a Tab
			String[] lineValues = JOrphanUtils.split(server.readLine(getFilename()), delim,false);
			for (int a = 0; a < vars.length && a < lineValues.length; a++) {
				this.getThreadContext().getVariables().put(vars[a], lineValues[a]);
			}
=======
			if (delim.equals("\\t")) // $NON-NLS-1$
				delim = "\t";// Make it easier to enter a Tab // $NON-NLS-1$
            JMeterVariables threadVars = this.getThreadContext().getVariables();
			String line = server.readLine(_fileName,getRecycle());
            if (line!=null) {// i.e. not EOF
                String[] lineValues = JOrphanUtils.split(line, delim,false);
    			for (int a = 0; a < vars.length && a < lineValues.length; a++) {
    				threadVars.put(vars[a], lineValues[a]);
    			}
    			// TODO - provide option to set unused variables ?
            } else {
            	if (getStopThread()) {
            		throw new JMeterStopThreadException("End of file detected");
            	}
                for (int a = 0; a < vars.length ; a++) {
                    threadVars.put(vars[a], EOFVALUE);
                }
            }
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		} catch (IOException e) {
			log.error(e.toString());
		}
Solution content
		}
		try {
			String delim = getDelimiter();
			if (delim.equals("\\t")) // $NON-NLS-1$
				delim = "\t";// Make it easier to enter a Tab // $NON-NLS-1$
            JMeterVariables threadVars = this.getThreadContext().getVariables();
			String line = server.readLine(_fileName,getRecycle());
            if (line!=null) {// i.e. not EOF
    			}
                String[] lineValues = JOrphanUtils.split(line, delim,false);
    			for (int a = 0; a < vars.length && a < lineValues.length; a++) {
    				threadVars.put(vars[a], lineValues[a]);
    			// TODO - provide option to set unused variables ?
            } else {
            	if (getStopThread()) {
            		throw new JMeterStopThreadException("End of file detected");
            	}
                for (int a = 0; a < vars.length ; a++) {
                    threadVars.put(vars[a], EOFVALUE);
                }
            }
		} catch (IOException e) {
			log.error(e.toString());
		}
File
CSVDataSet.java
Developer's decision
Version 2
Kind of conflict
For statement
If statement
Method invocation
Variable
Chunk
Conflicting content
			// setDone(true);
			resetLoopCount();
			return null;
<<<<<<< HEAD
		} else {
			return doNext();
=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		}
		return next();
	}
Solution content
			// setDone(true);
			resetLoopCount();
			return null;
		}
		return next();
	}
File
ForeachController.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Return statement
Chunk
Conflicting content
		Sampler sampler = controller.next();
		if (sampler == null) {
			currentReturnedNull(controller);
<<<<<<< HEAD
			return doNext();
=======
			return next();
		}
		currentReturnedAtLeastOne = true;
		if (getStyle() == IGNORE_SUB_CONTROLLERS) {
			incrementCurrent();
			skipNext = true;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		} else {
			searchStart = null;
		}
Solution content
		Sampler sampler = controller.next();
		if (sampler == null) {
			currentReturnedNull(controller);
			return next();
		}
		currentReturnedAtLeastOne = true;
		if (getStyle() == IGNORE_SUB_CONTROLLERS) {
			incrementCurrent();
			skipNext = true;
		} else {
			searchStart = null;
		}
File
InterleaveControl.java
Developer's decision
Version 2
Kind of conflict
Attribute
If statement
Method invocation
Return statement
Chunk
Conflicting content
import org.apache.jmeter.testelement.property.NullProperty;
import org.apache.jorphan.collections.HashTree;
import org.apache.jorphan.collections.ListedHashTree;
<<<<<<< HEAD
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;
=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

/**
 * The goal of ModuleController is to add modularity to JMeter. The general idea
Solution content
import org.apache.jmeter.testelement.property.NullProperty;
import org.apache.jorphan.collections.HashTree;
import org.apache.jorphan.collections.ListedHashTree;

/**
 * The goal of ModuleController is to add modularity to JMeter. The general idea
File
ModuleController.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
	 * 
	 */
	public HashTree getReplacementSubTree() {
<<<<<<< HEAD
		if (!selectedNode.isEnabled()) {
			selectedNode = cloneTreeNode(selectedNode);
			selectedNode.setEnabled(true);
		}
		HashTree tree = new ListedHashTree();
		tree.add(selectedNode);
		createSubTree(tree, selectedNode);
=======
        HashTree tree = new ListedHashTree();
        if (selectedNode != null) {
    		if (!selectedNode.isEnabled()) {
    			selectedNode = cloneTreeNode(selectedNode);
    			selectedNode.setEnabled(true);
    		}
    		tree.add(selectedNode);
    		createSubTree(tree, selectedNode);
        }
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		return tree;
	}
Solution content
	 * 
	 */
	public HashTree getReplacementSubTree() {
        HashTree tree = new ListedHashTree();
        if (selectedNode != null) {
    		if (!selectedNode.isEnabled()) {
    			selectedNode = cloneTreeNode(selectedNode);
    			selectedNode.setEnabled(true);
    		}
    		tree.add(selectedNode);
    		createSubTree(tree, selectedNode);
        }
		return tree;
	}
File
ModuleController.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Variable
Chunk
Conflicting content
		return getPropertyAsString(VAR_NAME);
	}

<<<<<<< HEAD
	/* (non-Javadoc)
	 * @see org.apache.jmeter.engine.event.LoopIterationListener#iterationEnd(org.apache.jmeter.engine.event.LoopIterationEvent)
	 */
	public void iterationEnd(LoopIterationEvent iterEvent) {
	}
=======
    public void setFormat(String format) {
        setProperty(FORMAT, format);
    }

    public String getFormat() {
        return getPropertyAsString(FORMAT);
    }
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
}
Solution content
		return getPropertyAsString(VAR_NAME);
	}

    public void setFormat(String format) {
        setProperty(FORMAT, format);
    }

    public String getFormat() {
        return getPropertyAsString(FORMAT);
    }
}
File
CounterConfig.java
Developer's decision
Version 2
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
		delay = getPropertyAsLong(DELAY);

	}
<<<<<<< HEAD

	/* (non-Javadoc)
	 * @see org.apache.jmeter.engine.event.LoopIterationListener#iterationEnd(org.apache.jmeter.engine.event.LoopIterationEvent)
	 */
	public void iterationEnd(LoopIterationEvent iterEvent) {
	}

	/*
	 * This method doesn't appear to be used anymore. jeremy_a@bigfoot.com 02
	 * May 2003
	 * 
	 * Make changes to variables available elsewhere.
	 * 
	 * @see ThreadListener#setJMeterVariables(JMeterVariables) public void
	 *      setJMeterVariables(JMeterVariables jmVars) {
	 *      //vars.addJMeterVariables(jmVars); }
	 */

=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
}
Solution content
		delay = getPropertyAsLong(DELAY);

	}
}
File
ConstantTimer.java
Developer's decision
Version 2
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
		return panel;
	}
<<<<<<< HEAD
=======

	private static class ResultsNodeRenderer extends DefaultTreeCellRenderer {
		public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded,
				boolean leaf, int row, boolean focus) {
			super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, focus);
			boolean failure = true;
			Object userObject = ((DefaultMutableTreeNode) value).getUserObject();
			if(userObject instanceof SampleResult) {
				failure = !(((SampleResult) userObject).isSuccessful());
			}
			else if(userObject instanceof AssertionResult) {
				AssertionResult assertion = (AssertionResult) userObject;
				failure =  assertion.isError() || assertion.isFailure();
			}
			
			// Set the status for the node
			if (failure) {
				this.setForeground(Color.red);
				this.setIcon(imageFailure);
			} else {
				this.setIcon(imageSuccess);
			}
			return this;
		}
	}

>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	private static class LocalHTMLEditorKit extends HTMLEditorKit {

		private static final ViewFactory defaultFactory = new LocalHTMLFactory();
Solution content
		return panel;
	}

	private static class ResultsNodeRenderer extends DefaultTreeCellRenderer {
		public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded,
				boolean leaf, int row, boolean focus) {
			super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, focus);
			boolean failure = true;
			Object userObject = ((DefaultMutableTreeNode) value).getUserObject();
			if(userObject instanceof SampleResult) {
				failure = !(((SampleResult) userObject).isSuccessful());
			}
			else if(userObject instanceof AssertionResult) {
				AssertionResult assertion = (AssertionResult) userObject;
				failure =  assertion.isError() || assertion.isFailure();
			}
			
			// Set the status for the node
			if (failure) {
				this.setForeground(Color.red);
				this.setIcon(imageFailure);
			} else {
				this.setIcon(imageSuccess);
			}
			return this;
		}
	}

	private static class LocalHTMLEditorKit extends HTMLEditorKit {

		private static final ViewFactory defaultFactory = new LocalHTMLFactory();
File
ViewResultsFullVisualizer.java
Developer's decision
Version 2
Kind of conflict
Class declaration
Chunk
Conflicting content
				Splash splash = new Splash();
				splash.showSplash();
				startGui(parser.getArgumentById(TESTFILE_OPT));
<<<<<<< HEAD
				startBSH();
				splash.removeSplash();
=======
				startOptionalServers();
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
			} else {
				CLOption rem=parser.getArgumentById(REMOTE_OPT_PARAM);
				if (rem==null) rem=parser.getArgumentById(REMOTE_OPT);
Solution content
				startGui(parser.getArgumentById(TESTFILE_OPT));
				startOptionalServers();
			} else {
				CLOption rem=parser.getArgumentById(REMOTE_OPT_PARAM);
				if (rem==null) rem=parser.getArgumentById(REMOTE_OPT);
File
JMeter.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
		// ClassFinder needs this
		System.setProperty("java.class.path", System.getProperty("java.class.path") + classpath.toString());
		loader = new DynamicClassLoader((URL[]) jars.toArray(new URL[0]));
<<<<<<< HEAD

=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}

	/**
Solution content
		// ClassFinder needs this
		System.setProperty("java.class.path", System.getProperty("java.class.path") + classpath.toString());
		loader = new DynamicClassLoader((URL[]) jars.toArray(new URL[0]));
	}

	/**
File
NewDriver.java
Developer's decision
Version 1
Kind of conflict
Blank
Chunk
Conflicting content
        }
    }
    
<<<<<<< HEAD
=======
    public static void addURL(URL url) {
        loader.addURL(url);
    }
    
    public static void addPath(String path) throws MalformedURLException {
		URL url = new URL("file","",path);
        loader.addURL(url);
    	StringBuffer sb = new StringBuffer(System.getProperty("java.class.path"));
    	sb.append(System.getProperty("path.separator"));
    	sb.append(path);
		// ClassFinder needs this
		System.setProperty("java.class.path",sb.toString());
    }
    
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	/**
	 * Get the directory where JMeter is installed. This is the absolute path
	 * name.
Solution content
        }
    }
    
    public static void addURL(URL url) {
        loader.addURL(url);
    }
    
    public static void addPath(String path) throws MalformedURLException {
		URL url = new URL("file","",path);
        loader.addURL(url);
    	StringBuffer sb = new StringBuffer(System.getProperty("java.class.path"));
    	sb.append(System.getProperty("path.separator"));
    	sb.append(path);
		// ClassFinder needs this
		System.setProperty("java.class.path",sb.toString());
    }
    
	/**
	 * Get the directory where JMeter is installed. This is the absolute path
	 * name.
File
NewDriver.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Chunk
Conflicting content
            } catch (Exception e) {
                e.printStackTrace();
<<<<<<< HEAD
=======
                System.out.println("JMeter home directory was detected as: "+jmDir);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
            }
        } else {
            try {
Solution content
            } catch (Exception e) {
                e.printStackTrace();
                System.out.println("JMeter home directory was detected as: "+jmDir);
            }
        } else {
            try {
File
NewDriver.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
            } catch (Exception e) {
                e.printStackTrace();
<<<<<<< HEAD
            }
=======
                System.out.println("JMeter home directory was detected as: "+jmDir);
           }
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
        }
	}
}
Solution content
            } catch (Exception e) {
                e.printStackTrace();
                System.out.println("JMeter home directory was detected as: "+jmDir);
           }
        }
	}
}
File
NewDriver.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
 * @author Mark Walsh
 */
public class Argument extends AbstractTestElement implements Serializable {
<<<<<<< HEAD
    private static Logger log = LoggingManager.getLoggerForClass();
	/** Name used to store the argument's name. */
=======
 	/** Name used to store the argument's name. */
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	public static final String ARG_NAME = "Argument.name";

	/** Name used to store the argument's value. */
Solution content
 * @author Mark Walsh
 */
public class Argument extends AbstractTestElement implements Serializable {
 	/** Name used to store the argument's name. */
	public static final String ARG_NAME = "Argument.name";

	/** Name used to store the argument's value. */
File
Argument.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method invocation
Chunk
Conflicting content
    /**
     * Create a new ArgumentsPanel with a border and color background
<<<<<<< HEAD
     * @param label
     * @param borderHeight
     * @param borderWidth
=======
     * @param label text for label
     * @param bkg background colour
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
     */
    public ArgumentsPanel(String label, Color bkg) {
        tableLabel = new JLabel(label);
Solution content
    /**
     * Create a new ArgumentsPanel with a border and color background
     * @param label text for label
     * @param bkg background colour
     */
    public ArgumentsPanel(String label, Color bkg) {
        tableLabel = new JLabel(label);
File
ArgumentsPanel.java
Developer's decision
Version 2
Kind of conflict
Comment
Chunk
Conflicting content
	/**
	 * @see org.apache.jmeter.control.Controller#next()
	 */
<<<<<<< HEAD
	public Sampler doNext() {
		boolean result = evaluateCondition(getCondition());
		if (result)
			return super.doNext();
		else
			try {
				return nextIsNull();
			} catch (NextIsNullException e1) {
				return null;
			}
	}

	// //////////////////////////// Start of Test Code
	// ///////////////////////////

	/**
	 * JUnit test
	 */
	public static class Test extends JMeterTestCase {
		public Test(String name) {
			super(name);
=======
	public Sampler next() {
        // We should only evalute the condition if it is the first
        // time ( first "iteration" ) we are called.
        // For subsequent calls, we are inside the IfControllerGroup,
        // so then we just pass the control to the next item inside the if control
        boolean result = true;
        if(isFirst()) {
            result = evaluateCondition(getCondition());
        }
        
		if (result) {
			return super.next();
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		}
		try {
			return nextIsNull();
Solution content
	/**
	 * @see org.apache.jmeter.control.Controller#next()
	 */
	public Sampler next() {
        // We should only evalute the condition if it is the first
        // time ( first "iteration" ) we are called.
        // For subsequent calls, we are inside the IfControllerGroup,
        // so then we just pass the control to the next item inside the if control
        boolean result = true;
        if(isFirst()) {
            result = evaluateCondition(getCondition());
        }
        
		if (result) {
			return super.next();
		}
		try {
			return nextIsNull();
File
IfController.java
Developer's decision
Version 2
Kind of conflict
Class signature
Comment
If statement
Method declaration
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
				resetLoopCount();
			}
			return null;
<<<<<<< HEAD
		} else {
			return doNext();
=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		}
		return next();
	}
Solution content
				resetLoopCount();
			}
			return null;
		}
		return next();
	}
File
LoopController.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Return statement
Chunk
Conflicting content
	 * @see org.apache.jorphan.collections.HashTree
	 */
	public HashTree getReplacementSubTree();
<<<<<<< HEAD
=======
	/**
     * Compute the replacement tree.
     * 
     * @param context
     */
    public void resolveReplacementSubTree(Object context);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
}
Solution content
	 * @see org.apache.jorphan.collections.HashTree
	 */
	public HashTree getReplacementSubTree();

	/**
     * Compute the replacement tree.
     * 
     * @param context
     */
    public void resolveReplacementSubTree(Object context);
}
File
ReplaceableController.java
Developer's decision
Version 2
Kind of conflict
Comment
Method interface
Chunk
Conflicting content
		if (endOfLoop()) {
			resetLoopCount();
			return null;
<<<<<<< HEAD
		} else {
			return doNext();
=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		}
		return next();
	}
Solution content
		if (endOfLoop()) {
			resetLoopCount();
			return null;
		}
		return next();
	}
File
RunTime.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Return statement
Chunk
Conflicting content
		}
		// Must be start of loop
		if (!endOfLoop(false)) {
<<<<<<< HEAD
			return super.doNext(); // OK to continue
		} else {
			reInitialize(); // Don't even start the loop
			return null;
=======
			return super.next(); // OK to continue
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		}
		reInitialize(); // Don't even start the loop
		return null;
Solution content
		}
		// Must be start of loop
		if (!endOfLoop(false)) {
			return super.next(); // OK to continue
		}
		reInitialize(); // Don't even start the loop
		return null;
File
WhileController.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Return statement
Chunk
Conflicting content
	public synchronized void threadFinished(JMeterThread thread) {
		try {
            allThreads.remove(thread);
<<<<<<< HEAD
            log.info("Ending thread " + thread.getThreadNum());
            if (!serialized && allThreads.size() == 0 && !schcdule_run) {
=======
            log.info("Ending thread " + thread.getThreadName());
            if (!serialized && !schcdule_run && !startingGroups && allThreads.size() == 0 ) {
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
            	log.info("Stopping test");
            	stopTest();
            }
Solution content
	public synchronized void threadFinished(JMeterThread thread) {
		try {
            allThreads.remove(thread);
            log.info("Ending thread " + thread.getThreadName());
            if (!serialized && !schcdule_run && !startingGroups && allThreads.size() == 0 ) {
            	log.info("Stopping test");
            	stopTest();
            }
File
StandardJMeterEngine.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
			serialized = true;
		}
        JMeterContextService.startTest();
<<<<<<< HEAD
		compileTree();
=======
        try {
        	compileTree();
	    } catch (RuntimeException e) {
	    	log.error("Error occurred compiling the tree:",e);
	    	JMeterUtils.reportErrorToUser("Error occurred compiling the tree: - see log file");
	    	return; // no point continuing
        }
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		/**
		 * Notification of test listeners needs to happen after function
		 * replacement, but before setting RunningVersion to true.
Solution content
			serialized = true;
		}
        JMeterContextService.startTest();
        try {
        	compileTree();
	    } catch (RuntimeException e) {
	    	log.error("Error occurred compiling the tree:",e);
	    	JMeterUtils.reportErrorToUser("Error occurred compiling the tree: - see log file");
	    	return; // no point continuing
        }
		/**
		 * Notification of test listeners needs to happen after function
		 * replacement, but before setting RunningVersion to true.
File
StandardJMeterEngine.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Try statement
Chunk
Conflicting content
            ListedHashTree threadGroupTree = (ListedHashTree) searcher.getSubTree(group);
            threadGroupTree.add(group, testLevelElements);
<<<<<<< HEAD
			for (int i = 0; running && i < threads.length; i++) {
				threads[i] = new JMeterThread(cloneTree(threadGroupTree), this, notifier);
				threads[i].setThreadNum(i);
				threads[i].setThreadGroup(group);
				threads[i].setInitialContext(JMeterContextService.getContext());
				threads[i].setInitialDelay((int) (perThreadDelay * i));
				threads[i].setThreadName(groupName + " " + (groupCount) + "-" + (i + 1));
=======
			for (int i = 0; running && i < numThreads; i++) {
                final JMeterThread jmeterThread = new JMeterThread(cloneTree(threadGroupTree), this, notifier);
                jmeterThread.setThreadNum(i);
				jmeterThread.setThreadGroup(group);
				jmeterThread.setInitialContext(JMeterContextService.getContext());
				jmeterThread.setInitialDelay((int) (perThreadDelay * i));
				jmeterThread.setThreadName(groupName + " " + (groupCount) + "-" + (i + 1));
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

				scheduleThread(jmeterThread, group);
Solution content
            ListedHashTree threadGroupTree = (ListedHashTree) searcher.getSubTree(group);
            threadGroupTree.add(group, testLevelElements);
			for (int i = 0; running && i < numThreads; i++) {
                final JMeterThread jmeterThread = new JMeterThread(cloneTree(threadGroupTree), this, notifier);
                jmeterThread.setThreadNum(i);
				jmeterThread.setThreadGroup(group);
				jmeterThread.setInitialContext(JMeterContextService.getContext());
				jmeterThread.setInitialDelay((int) (perThreadDelay * i));
				jmeterThread.setThreadName(groupName + " " + (groupCount) + "-" + (i + 1));

				scheduleThread(jmeterThread, group);
File
StandardJMeterEngine.java
Developer's decision
Version 2
Kind of conflict
Array access
For statement
Method invocation
Variable
Chunk
Conflicting content
	/** A GUI panel containing the name of this component. */
	protected NamePanel namePanel;
<<<<<<< HEAD
=======
    // used by AbstractReportGui
	
	private CommentPanel commentPanel;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

	/**
	 * When constructing a new component, this takes care of basic tasks like
Solution content
	/** A GUI panel containing the name of this component. */
	protected NamePanel namePanel;
    // used by AbstractReportGui
	
	private CommentPanel commentPanel;

	/**
	 * When constructing a new component, this takes care of basic tasks like
File
AbstractJMeterGuiComponent.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
	 */
	 * A window adapter used to detect when the main JMeter frame is being
	 * closed.
<<<<<<< HEAD
	protected class WindowHappenings extends WindowAdapter {
=======
	private static class WindowHappenings extends WindowAdapter {
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		/**
		 * Called when the main JMeter frame is being closed. Sends a
		 * notification so that JMeter can react appropriately.
Solution content
	 * A window adapter used to detect when the main JMeter frame is being
	 * closed.
	 */
	private static class WindowHappenings extends WindowAdapter {
		/**
		 * Called when the main JMeter frame is being closed. Sends a
		 * notification so that JMeter can react appropriately.
File
MainFrame.java
Developer's decision
Version 2
Kind of conflict
Class signature
Chunk
Conflicting content
			JPanel checkPanel = new JPanel(new GridLayout(x, 3));
			for (int i = 0; i < methods.length; i++) {
				String name = methods[i].getName();
<<<<<<< HEAD
				if (name.startsWith("save") && methods[i].getParameterTypes().length == 0) {
=======
				if (name.startsWith(NAME_SAVE_PFX) && methods[i].getParameterTypes().length == 0) {
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
					try {
						name = name.substring(NAME_SAVE_PFX_LEN);
						JCheckBox check = new JCheckBox(
Solution content
			JPanel checkPanel = new JPanel(new GridLayout(x, 3));
			for (int i = 0; i < methods.length; i++) {
				String name = methods[i].getName();
				if (name.startsWith(NAME_SAVE_PFX) && methods[i].getParameterTypes().length == 0) {
					try {
						name = name.substring(NAME_SAVE_PFX_LEN);
						JCheckBox check = new JCheckBox(
File
SavePropertyDialog.java
Developer's decision
Version 2
Kind of conflict
If statement
Chunk
Conflicting content
	 */
	abstract public Set getActionNames();

<<<<<<< HEAD
	protected void convertSubTree(HashTree tree) {
		Iterator iter = new LinkedList(tree.list()).iterator();
		while (iter.hasNext()) {
			Object o = iter.next();
			if(o instanceof TestElement)
				continue; //hey, no need to convert
			JMeterTreeNode item = (JMeterTreeNode) o;
			if (item.isEnabled()) {
				if (item.getUserObject() instanceof ReplaceableController) {
					ReplaceableController rc = (ReplaceableController) item.getTestElement();
					HashTree subTree = tree.getTree(item);

					if (subTree != null) {
						HashTree replacementTree = rc.getReplacementSubTree();
						convertSubTree(replacementTree);
						tree.replace(item,rc);
						tree.set(rc,replacementTree);
					}
				} else {
					convertSubTree(tree.getTree(item));
					TestElement testElement = item.getTestElement();
					tree.replace(item, testElement);
				}
			} else {
				tree.remove(item);
			}

		}
	}

=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	/**
	 * @param e
	 */
Solution content
	 */
	abstract public Set getActionNames();

	/**
	 * @param e
	 */
File
AbstractAction.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Chunk
Conflicting content
 * @version $Revision$
 */
public class JMeterTreeNode extends DefaultMutableTreeNode implements NamedTreeNode {
<<<<<<< HEAD
	transient private static Logger log = LoggingManager.getLoggerForClass();
=======
	private static final Logger log = LoggingManager.getLoggerForClass();
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

	private JMeterTreeModel treeModel;
Solution content
 * @version $Revision$
 */
public class JMeterTreeNode extends DefaultMutableTreeNode implements NamedTreeNode {
	private static final Logger log = LoggingManager.getLoggerForClass();

	private JMeterTreeModel treeModel;
File
JMeterTreeNode.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
	// MENU_ADD_xxx - controls which items are in the ADD menu
	// MENU_PARENT_xxx - controls which items are in the Insert Parent menu
<<<<<<< HEAD
	private static final String[] MENU_ADD_CONTROLLER = new String[] { MenuFactory.CONTROLLERS, MenuFactory.SAMPLERS,
			MenuFactory.ASSERTIONS, MenuFactory.CONFIG_ELEMENTS, MenuFactory.TIMERS, MenuFactory.LISTENERS, MenuFactory.PRE_PROCESSORS,
			MenuFactory.POST_PROCESSORS };

	private static final String[] MENU_PARENT_CONTROLLER = new String[] { MenuFactory.CONTROLLERS };

	private static final String[] MENU_ADD_SAMPLER = new String[] { MenuFactory.CONFIG_ELEMENTS,
			MenuFactory.ASSERTIONS, MenuFactory.TIMERS, MenuFactory.LISTENERS, MenuFactory.PRE_PROCESSORS,
			MenuFactory.POST_PROCESSORS };

	private static final String[] MENU_PARENT_SAMPLER = new String[] { MenuFactory.CONTROLLERS };

	private static List timers, controllers, samplers, configElements, assertions, listeners, nonTestElements,
			postProcessors, preProcessors;

	// private static JMenu timerMenu;
	// private static JMenu controllerMenu;
	// private static JMenu generativeControllerMenu;
	// private static JMenu listenerMenu;
	// private static JMenu assertionMenu;
	// private static JMenu configMenu;
	// private static JMenu insertControllerMenu;
	// private static JMenu postProcessorMenu;
	// private static JMenu preProcessorMenu;
=======
	private static final String[] MENU_ADD_CONTROLLER = new String[] {
        MenuFactory.CONTROLLERS, 
        MenuFactory.SAMPLERS,
		MenuFactory.ASSERTIONS, 
		MenuFactory.CONFIG_ELEMENTS, 
        MenuFactory.TIMERS, 
        MenuFactory.LISTENERS, 
        MenuFactory.PRE_PROCESSORS,
		MenuFactory.POST_PROCESSORS };

	private static final String[] MENU_PARENT_CONTROLLER = new String[] { 
        MenuFactory.CONTROLLERS };

	private static final String[] MENU_ADD_SAMPLER = new String[] { 
        MenuFactory.CONFIG_ELEMENTS,
		MenuFactory.ASSERTIONS, 
		MenuFactory.TIMERS, 
		MenuFactory.LISTENERS, 
        MenuFactory.PRE_PROCESSORS,
		MenuFactory.POST_PROCESSORS };

	private static final String[] MENU_PARENT_SAMPLER = new String[] { 
        MenuFactory.CONTROLLERS };

	private static List timers, controllers, samplers, configElements, 
        assertions, listeners, nonTestElements,
		postProcessors, preProcessors;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

	static {
		try {
Solution content
	// MENU_ADD_xxx - controls which items are in the ADD menu
	// MENU_PARENT_xxx - controls which items are in the Insert Parent menu
	private static final String[] MENU_ADD_CONTROLLER = new String[] {
        MenuFactory.CONTROLLERS, 
        MenuFactory.SAMPLERS,
		MenuFactory.ASSERTIONS, 
		MenuFactory.CONFIG_ELEMENTS, 
        MenuFactory.TIMERS, 
        MenuFactory.LISTENERS, 
        MenuFactory.PRE_PROCESSORS,
		MenuFactory.POST_PROCESSORS };

	private static final String[] MENU_PARENT_CONTROLLER = new String[] { 
        MenuFactory.CONTROLLERS };

	private static final String[] MENU_ADD_SAMPLER = new String[] { 
        MenuFactory.CONFIG_ELEMENTS,
		MenuFactory.ASSERTIONS, 
		MenuFactory.TIMERS, 
		MenuFactory.LISTENERS, 
        MenuFactory.PRE_PROCESSORS,
		MenuFactory.POST_PROCESSORS };

	private static final String[] MENU_PARENT_SAMPLER = new String[] { 
        MenuFactory.CONTROLLERS };

	private static List timers, controllers, samplers, configElements, 
        assertions, listeners, nonTestElements,
		postProcessors, preProcessors;

	static {
		try {
File
MenuFactory.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method invocation
Chunk
Conflicting content
        if (file.exists()) {
			clearVisualizer();
			BufferedReader dataReader = null;
<<<<<<< HEAD
			try {
				readSamples(SaveService.loadTestResults(new BufferedInputStream(new FileInputStream(getFilename()))));
				parsedOK = true;
			} catch (Exception e) {
				log.warn("File load failure, trying old data format.");
				try {
					Configuration savedSamples = getConfiguration(getFilename());
					Configuration[] samples = savedSamples.getChildren();
					for (int i = 0; i < samples.length; i++) {
						SampleResult result = OldSaveService.getSampleResult(samples[i]);
						sendToVisualizer(result);
					}
				} catch (Exception e1) {
					log.warn("Error parsing XML results " + e);
					log.info("Assuming CSV format instead");
					dataReader = new BufferedReader(new FileReader(getFilename()));
					String line;
					while ((line = dataReader.readLine()) != null) {
						sendToVisualizer(OldSaveService.makeResultFromDelimitedString(line,getSaveConfig()));
					}
					parsedOK = true;
				}
			} finally {
				if (dataReader != null)
					dataReader.close();
				if (!parsedOK) {
					SampleResult sr = new SampleResult();
					sr.setSampleLabel("Error loading results file - see log file");
					sendToVisualizer(sr);
=======
            BufferedInputStream bufferedInputStream = null;
            try {
                dataReader = new BufferedReader(new FileReader(file));
                // Get the first line, and see if it is XML
                String line = dataReader.readLine();
                if (line == null) {
                    log.warn(filename+" is empty");
                } else {
                    if (!line.startsWith(">>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
				}
			}
		}
Solution content
        if (file.exists()) {
			clearVisualizer();
			BufferedReader dataReader = null;
            BufferedInputStream bufferedInputStream = null;
            try {
                dataReader = new BufferedReader(new FileReader(file));
                // Get the first line, and see if it is XML
                String line = dataReader.readLine();
                if (line == null) {
                    log.warn(filename+" is empty");
                } else {
                    if (!line.startsWith("
File
ResultCollector.java
Developer's decision
Version 2
Kind of conflict
Catch clause
Comment
If statement
Method invocation
Try statement
Variable
Chunk
Conflicting content
	 * 
	 * @return
	 */
<<<<<<< HEAD
	public int getContentLength() {
		return contentLength;
	}

	// //////////////////////////// Start of Test Code
	// ///////////////////////////

	// TODO need more tests - particularly for the new functions

	public static class Test extends TestCase {
		public Test(String name) {
			super(name);
		}

		public void testElapsed() throws Exception {
			SampleResult res = new SampleResult();

			// Check sample increments OK
			res.sampleStart();
			Thread.sleep(100);
			res.sampleEnd();
			assertTrue(res.getTime() >= 100);
		}

		public void testPause() throws Exception {
			SampleResult res = new SampleResult();
			// Check sample increments OK
			res.sampleStart();
			Thread.sleep(100);
			res.samplePause();

			Thread.sleep(200);

			// Re-increment
			res.sampleResume();
			Thread.sleep(100);
			res.sampleEnd();
			long sampleTime = res.getTime();
			if ((sampleTime < 200) || (sampleTime > 290)) {
				fail("Accumulated time (" + sampleTime + ") was not between 200 and 290 ms");
			}
		}

		private static Formatter fmt = new RawFormatter();

		private StringWriter wr = null;

		public void divertLog() {
			wr = new StringWriter(1000);
			LogTarget[] lt = { new WriterTarget(wr, fmt) };
			log.setLogTargets(lt);
		}

		public void testPause2() throws Exception {
			divertLog();
			SampleResult res = new SampleResult();
			res.sampleStart();
			res.samplePause();
			assertTrue(wr.toString().length() == 0);
			res.samplePause();
			assertFalse(wr.toString().length() == 0);
		}
		// TODO some more invalid sequence tests needed
=======
	public int getBytes() {
		return bytes == 0 ? responseData.length : bytes;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}

	/**
Solution content
	 * 
	 * @return
	 */
	public int getBytes() {
		return bytes == 0 ? responseData.length : bytes;
	}

	/**
File
SampleResult.java
Developer's decision
Version 2
Kind of conflict
Attribute
Class signature
Comment
Method declaration
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
	 * The name of the property indicating whether the success indicator should
	 * be saved.
	 **************************************************************************/
<<<<<<< HEAD
	public static final String SAVE_SUCCESSFUL_PROP = "jmeter.save.saveservice.successful";
	
	public static final String SAVE_CONTENT_LENGTH = "jmeter.save.saveservice.content_length";
=======
	private static final String SAVE_SUCCESSFUL_PROP = "jmeter.save.saveservice.successful"; // $NON_NLS-1$
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

	/***************************************************************************
	 * The name of the property indicating whether the thread name should be
Solution content
	 * The name of the property indicating whether the success indicator should
	 * be saved.
	 **************************************************************************/
	private static final String SAVE_SUCCESSFUL_PROP = "jmeter.save.saveservice.successful"; // $NON_NLS-1$

	/***************************************************************************
	 * The name of the property indicating whether the thread name should be
File
SampleSaveConfiguration.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
		return delimiter;
	}

<<<<<<< HEAD
	/**
	 * @param contentLength The contentLength to set.
	 */
	public void setContentLength(boolean contentLength) {
		this.contentLength = contentLength;
	}
	
	public boolean saveContentLength()
	{
		return contentLength;
=======
    public String getXmlPi() {
        return JMeterUtils.getJMeterProperties().getProperty(XML_PI, ""); // Defaults to empty;
    }

    // Used by SampleSaveConfigurationConverter.unmarshall()
	public void setDefaultDelimiter() {
		delimiter=_delimiter;
	}

    // Used by SampleSaveConfigurationConverter.unmarshall()
	public void setDefaultTimeStampFormat() {
		printMilliseconds=_printMilliseconds;
		formatter=_formatter;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}
}
Solution content
		return delimiter;
	}

    public String getXmlPi() {
        return JMeterUtils.getJMeterProperties().getProperty(XML_PI, ""); // Defaults to empty;
    }

    // Used by SampleSaveConfigurationConverter.unmarshall()
	public void setDefaultDelimiter() {
		delimiter=_delimiter;
	}

    // Used by SampleSaveConfigurationConverter.unmarshall()
	public void setDefaultTimeStampFormat() {
		printMilliseconds=_printMilliseconds;
		formatter=_formatter;
	}
}
File
SampleSaveConfiguration.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method declaration
Method signature
Return statement
Chunk
Conflicting content
		} else if (type.equalsIgnoreCase("Batch")) {
			BatchSampleSender b = new BatchSampleSender(listener);
			return b;
<<<<<<< HEAD
		} else if(type.equalsIgnoreCase("Full")) {
=======
		} else if (type.equalsIgnoreCase("Statistical")) {
			StatisticalSampleSender s = new StatisticalSampleSender(listener);
			return s;
		} else {
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
			StandardSampleSender s = new StandardSampleSender(listener);
			return s;
		}  else if(type.equalsIgnoreCase("Stripped Batch")) {
Solution content
		} else if (type.equalsIgnoreCase("Batch")) {
			BatchSampleSender b = new BatchSampleSender(listener);
			return b;
		} else if (type.equalsIgnoreCase("Statistical")) {
			StatisticalSampleSender s = new StatisticalSampleSender(listener);
			return s;
		} else {
			StandardSampleSender s = new StandardSampleSender(listener);
			return s;
File
SampleSenderFactory.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Return statement
Variable
Chunk
Conflicting content
import org.apache.jorphan.collections.HashTree;
import org.apache.jorphan.collections.ListedHashTree;
import org.apache.jorphan.logging.LoggingManager;
<<<<<<< HEAD
import org.apache.jorphan.util.Converter;
import org.apache.jorphan.util.JOrphanUtils;
=======
import org.apache.jorphan.reflect.Functor;
import org.apache.jorphan.util.JMeterError;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
import org.apache.log.Logger;
import org.xml.sax.SAXException;
Solution content
import org.apache.jorphan.collections.HashTree;
import org.apache.jorphan.collections.ListedHashTree;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.jorphan.reflect.Functor;
import org.apache.jorphan.util.JMeterError;
import org.apache.log.Logger;
import org.xml.sax.SAXException;
File
OldSaveService.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
		return makeResultFromDelimitedString(delim,_saveConfig);
	}

<<<<<<< HEAD
	/**
	 * Make a SampleResult given a delimited string.
	 * 
	 * @param delim
	 * @return SampleResult
	 */
	public static SampleResult makeResultFromDelimitedString(String delim,SampleSaveConfiguration saveConfig) {
		SampleResult result = null;
		long timeStamp = 0;
		long elapsed = 0;
		StringTokenizer splitter = new StringTokenizer(delim, saveConfig.getDelimiter());
=======
    //////////////////////////////////////////////////////////////////////////////
    //                  Start of CSV methods
    
    // TODO - move to separate file? If so, remember that some of the
      
    /**
     * Make a SampleResult given a delimited string.
     * 
     * @param inputLine - line from CSV file
     * @param saveConfig - configuration
     * @param lineNumber - line number for error reporting
     * @return SampleResult or null if header line detected
     * 
     * @throws JMeterError
     */
    public static SampleResult makeResultFromDelimitedString(
    		final String inputLine, 
    		final SampleSaveConfiguration saveConfig, // may be updated
    		final long lineNumber) {
 
    	SampleResult result = null;
		long timeStamp = 0;
		long elapsed = 0;
		/*
		 * Bug 40772: replaced StringTokenizer with String.split(), as the
		 * former does not return empty tokens.
		 */
		// The \Q prefix is needed to ensure that meta-characters (e.g. ".") work.
		String parts[]=inputLine.split("\\Q"+_saveConfig.getDelimiter());// $NON-NLS-1$
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		String text = null;
		String field = null; // Save the name for error reporting
		int i=0;
Solution content
     */

    //////////////////////////////////////////////////////////////////////////////
    //                  Start of CSV methods
    
    // TODO - move to separate file? If so, remember that some of the
      
    /**
     * Make a SampleResult given a delimited string.
     * 
     * @param inputLine - line from CSV file
     * @param saveConfig - configuration
     * @param lineNumber - line number for error reporting
     * @return SampleResult or null if header line detected
     * 
     * @throws JMeterError
    public static SampleResult makeResultFromDelimitedString(
    		final String inputLine, 
    		final SampleSaveConfiguration saveConfig, // may be updated
    		final long lineNumber) {
 
    	SampleResult result = null;
		long timeStamp = 0;
		long elapsed = 0;
		/*
		 * Bug 40772: replaced StringTokenizer with String.split(), as the
		 * former does not return empty tokens.
		 */
		// The \Q prefix is needed to ensure that meta-characters (e.g. ".") work.
		String parts[]=inputLine.split("\\Q"+_saveConfig.getDelimiter());// $NON-NLS-1$
		String text = null;
		String field = null; // Save the name for error reporting
		int i=0;
File
OldSaveService.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Method signature
Variable
Chunk
Conflicting content
		int i=0;

		try {
<<<<<<< HEAD
			if (saveConfig.printMilliseconds()) {
				text = splitter.nextToken();
				timeStamp = Long.parseLong(text);
			} else if (saveConfig.formatter() != null) {
				text = splitter.nextToken();
				Date stamp = saveConfig.formatter().parse(text);
				timeStamp = stamp.getTime();
			}

			if (saveConfig.saveTime()) {
				text = splitter.nextToken();
=======
			if (saveConfig.saveTimestamp()){
				field = TIME_STAMP;
				text = parts[i++];
				if (saveConfig.printMilliseconds()) {
					try {
						timeStamp = Long.parseLong(text);
					} catch (NumberFormatException e) {// see if this works
						log.warn(e.toString());
						Date stamp = DEFAULT_DATE_FORMAT.parse(text);
						timeStamp = stamp.getTime();
						log.warn("Setting date format to: "+DEFAULT_DATE_FORMAT_STRING);
						saveConfig.setFormatter(DEFAULT_DATE_FORMAT);
					}
				} else if (saveConfig.formatter() != null) {
					Date stamp = saveConfig.formatter().parse(text);
					timeStamp = stamp.getTime();
				} else { // can this happen?
					final String msg = "Unknown timestamp format";
					log.warn(msg);
					throw new JMeterError(msg);
				}
			}

			if (saveConfig.saveTime()) {
				field = CSV_ELAPSED;
				text = parts[i++];
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
				elapsed = Long.parseLong(text);
			}
Solution content
		int i=0;

		try {
			if (saveConfig.saveTimestamp()){
				field = TIME_STAMP;
				text = parts[i++];
				if (saveConfig.printMilliseconds()) {
					try {
						timeStamp = Long.parseLong(text);
					} catch (NumberFormatException e) {// see if this works
						log.warn(e.toString());
						Date stamp = DEFAULT_DATE_FORMAT.parse(text);
						timeStamp = stamp.getTime();
						log.warn("Setting date format to: "+DEFAULT_DATE_FORMAT_STRING);
						saveConfig.setFormatter(DEFAULT_DATE_FORMAT);
					}
				} else if (saveConfig.formatter() != null) {
					Date stamp = saveConfig.formatter().parse(text);
					timeStamp = stamp.getTime();
				} else { // can this happen?
					final String msg = "Unknown timestamp format";
					log.warn(msg);
					throw new JMeterError(msg);
				}
			}

			if (saveConfig.saveTime()) {
				field = CSV_ELAPSED;
				text = parts[i++];
				elapsed = Long.parseLong(text);
			}
File
OldSaveService.java
Developer's decision
Version 2
Kind of conflict
Array access
Attribute
If statement
Method invocation
Variable
Chunk
Conflicting content
			result = new SampleResult(timeStamp, elapsed);

<<<<<<< HEAD
			if (saveConfig.saveContentLength()) {
				text = splitter.nextToken();
				result.setContentLength(Converter.getInt(text));
			}

			if (saveConfig.saveLabel()) {
				text = splitter.nextToken();
				result.setSampleLabel(text);
			}
			if (saveConfig.saveCode()) {
				text = splitter.nextToken();
=======
			if (saveConfig.saveLabel()) {
				field = LABEL;
				text = parts[i++];
				result.setSampleLabel(text);
			}
			if (saveConfig.saveCode()) {
				field = RESPONSE_CODE;
				text = parts[i++];
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
				result.setResponseCode(text);
			}
Solution content
			result = new SampleResult(timeStamp, elapsed);

			if (saveConfig.saveLabel()) {
				field = LABEL;
				text = parts[i++];
				result.setSampleLabel(text);
			}
			if (saveConfig.saveCode()) {
				field = RESPONSE_CODE;
				text = parts[i++];
				result.setResponseCode(text);
			}
File
OldSaveService.java
Developer's decision
Version 2
Kind of conflict
Array access
Attribute
If statement
Method invocation
Variable
Chunk
Conflicting content
			}

			if (saveConfig.saveMessage()) {
<<<<<<< HEAD
				text = splitter.nextToken();
=======
				field = RESPONSE_MESSAGE;
				text = parts[i++];
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
				result.setResponseMessage(text);
			}
Solution content
			}

			if (saveConfig.saveMessage()) {
				field = RESPONSE_MESSAGE;
				text = parts[i++];
				result.setResponseMessage(text);
			}
File
OldSaveService.java
Developer's decision
Version 2
Kind of conflict
Array access
Attribute
Method invocation
Variable
Chunk
Conflicting content
			}

			if (saveConfig.saveThreadName()) {
<<<<<<< HEAD
				text = splitter.nextToken();
=======
				field = THREAD_NAME;
				text = parts[i++];
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
				result.setThreadName(text);
			}
Solution content
			}

			if (saveConfig.saveThreadName()) {
				field = THREAD_NAME;
				text = parts[i++];
				result.setThreadName(text);
			}
File
OldSaveService.java
Developer's decision
Version 2
Kind of conflict
Array access
Attribute
Method invocation
Variable
Chunk
Conflicting content
			}

			if (saveConfig.saveDataType()) {
<<<<<<< HEAD
				text = splitter.nextToken();
=======
				field = DATA_TYPE;
				text = parts[i++];
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
				result.setDataType(text);
			}
Solution content
			}

			if (saveConfig.saveDataType()) {
				field = DATA_TYPE;
				text = parts[i++];
				result.setDataType(text);
			}
File
OldSaveService.java
Developer's decision
Version 2
Kind of conflict
Array access
Attribute
Method invocation
Variable
Chunk
Conflicting content
			}

			if (saveConfig.saveSuccess()) {
<<<<<<< HEAD
				text = splitter.nextToken();
=======
				field = SUCCESSFUL;
				text = parts[i++];
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
				result.setSuccessful(Boolean.valueOf(text).booleanValue());
			}
Solution content
			}

			if (saveConfig.saveSuccess()) {
				field = SUCCESSFUL;
				text = parts[i++];
				result.setSuccessful(Boolean.valueOf(text).booleanValue());
			}
File
OldSaveService.java
Developer's decision
Version 2
Kind of conflict
Array access
Attribute
Method invocation
Variable
Chunk
Conflicting content
			}

			if (saveConfig.saveAssertionResultsFailureMessage()) {
<<<<<<< HEAD
				text = splitter.nextToken();
=======
				i++;
                // TODO - should this be restored?
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
			}
            
            if (saveConfig.saveBytes()) {
Solution content
			}

			if (saveConfig.saveAssertionResultsFailureMessage()) {
				i++;
                // TODO - should this be restored?
			}
            
            if (saveConfig.saveBytes()) {
File
OldSaveService.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Variable
Chunk
Conflicting content
		return config;
	}

<<<<<<< HEAD
	/**
	 * Convert a result into a string, where the fields of the result are
	 * separated by the default delimiter.
	 * 
	 * @param sample
	 *            the test result to be converted
	 * @return the separated value representation of the result
	 */
	public static String resultToDelimitedString(SampleResult sample) {
		return resultToDelimitedString(sample, sample.getSaveConfig().getDelimiter());
	}

	/**
	 * Convert a result into a string, where the fields of the result are
	 * separated by a specified String.
	 * 
	 * @param sample
	 *            the test result to be converted
	 * @param delimiter
	 *            the separation string
	 * @return the separated value representation of the result
	 */
	public static String resultToDelimitedString(SampleResult sample, String delimiter) {
		StringBuffer text = new StringBuffer();
		SampleSaveConfiguration saveConfig = sample.getSaveConfig();

		if (saveConfig.saveTimestamp()) {
			text.append(sample.getTimeStamp());
			text.append(delimiter);
		} else if (saveConfig.formatter() != null) {
			String stamp = saveConfig.formatter().format(new Date(sample.getTimeStamp()));
			text.append(stamp);
			text.append(delimiter);
		}

		if (saveConfig.saveTime()) {
			text.append(sample.getTime());
			text.append(delimiter);
		}

		if (saveConfig.saveContentLength()) {
			text.append(sample.getContentLength());
			text.append(delimiter);
		}

		if (saveConfig.saveLabel()) {
			text.append(sample.getSampleLabel());
			text.append(delimiter);
		}

		if (saveConfig.saveCode()) {
			text.append(sample.getResponseCode());
			text.append(delimiter);
		}

		if (saveConfig.saveMessage()) {
			text.append(sample.getResponseMessage());
			text.append(delimiter);
		}

		if (saveConfig.saveThreadName()) {
			text.append(sample.getThreadName());
			text.append(delimiter);
		}

		if (saveConfig.saveDataType()) {
			text.append(sample.getDataType());
			text.append(delimiter);
		}

		if (saveConfig.saveSuccess()) {
			text.append(sample.isSuccessful());
			text.append(delimiter);
		}

		if (saveConfig.saveAssertionResultsFailureMessage()) {
			String message = null;
			AssertionResult[] results = sample.getAssertionResults();

			if ((results != null) && (results.length > 0)) {
				message = results[0].getFailureMessage();
			}

			if (message != null) {
				text.append(message);
			}
			text.append(delimiter);
		}
		// text.append(sample.getSamplerData().toString());
		// text.append(getAssertionResult(sample));

		String resultString = null;
		int size = text.length();
		int delSize = delimiter.length();

		// Strip off the trailing delimiter
		if (size >= delSize) {
			resultString = text.substring(0, size - delSize);
		} else {
			resultString = text.toString();
		}
		return resultString;
	}

=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	public static Configuration getConfigForTestElement(String named, TestElement item) {
		TestElementSaver saver = new TestElementSaver(named);
		item.traverse(saver);
Solution content
		return config;
	}

	public static Configuration getConfigForTestElement(String named, TestElement item) {
		TestElementSaver saver = new TestElementSaver(named);
		item.traverse(saver);
File
OldSaveService.java
Developer's decision
Version 2
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
    static boolean checkVersions() {
		versionsOK = true;
<<<<<<< HEAD
		checkVersion(BooleanPropertyConverter.class, "1.5");
		checkVersion(HashTreeConverter.class, "1.3");
		checkVersion(IntegerPropertyConverter.class, "1.4");
		checkVersion(LongPropertyConverter.class, "1.4");
		checkVersion(MultiPropertyConverter.class, "1.4");
		checkVersion(SampleResultConverter.class, "1.10");
		/*
		 * Should check this, but tricky to do, because not built until later.
		 * 
		 * checkVersion(HTTPResultConverter.class, "1.6");
		 * 
		 */
		checkVersion(StringPropertyConverter.class, "1.7");
		checkVersion(TestElementConverter.class, "1.4");
		checkVersion(TestElementPropertyConverter.class, "1.7");
		checkVersion(ScriptWrapperConverter.class, "1.6");
		checkVersion(TestResultWrapperConverter.class, "1.5");
		if (!PROPVERSION.equalsIgnoreCase(propertiesVersion)) {
			log.warn("Property file - expected " + PROPVERSION + ", found " + propertiesVersion);
=======
		checkVersion(BooleanPropertyConverter.class, "493779"); // $NON-NLS-1$
		checkVersion(HashTreeConverter.class, "514283"); // $NON-NLS-1$
		checkVersion(IntegerPropertyConverter.class, "493779"); // $NON-NLS-1$
		checkVersion(LongPropertyConverter.class, "493779"); // $NON-NLS-1$
		checkVersion(MultiPropertyConverter.class, "514283"); // $NON-NLS-1$
		checkVersion(SampleResultConverter.class, "571992"); // $NON-NLS-1$

        // Not built until later, so need to use this method:
        try {
            checkVersion(
                    Class.forName("org.apache.jmeter.protocol.http.util.HTTPResultConverter"), // $NON-NLS-1$
                    "514283"); // $NON-NLS-1$
        } catch (ClassNotFoundException e) {
            versionsOK = false;
            log.warn(e.getLocalizedMessage());
        }
		checkVersion(StringPropertyConverter.class, "493779"); // $NON-NLS-1$
		checkVersion(TestElementConverter.class, "549987"); // $NON-NLS-1$
		checkVersion(TestElementPropertyConverter.class, "549987"); // $NON-NLS-1$
		checkVersion(ScriptWrapperConverter.class, "514283"); // $NON-NLS-1$
		checkVersion(TestResultWrapperConverter.class, "514283"); // $NON-NLS-1$
        checkVersion(SampleSaveConfigurationConverter.class,"549936"); // $NON-NLS-1$

        if (!PROPVERSION.equalsIgnoreCase(propertiesVersion)) {
			log.warn("Bad _version - expected " + PROPVERSION + ", found " + propertiesVersion + ".");
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		}
        if (!FILEVERSION.equalsIgnoreCase(fileVersion)) {
            log.warn("Bad _file_version - expected " + FILEVERSION + ", found " + fileVersion +".");
Solution content
    static boolean checkVersions() {
		versionsOK = true;
		checkVersion(BooleanPropertyConverter.class, "493779"); // $NON-NLS-1$
		checkVersion(HashTreeConverter.class, "514283"); // $NON-NLS-1$
		checkVersion(IntegerPropertyConverter.class, "493779"); // $NON-NLS-1$
		checkVersion(LongPropertyConverter.class, "493779"); // $NON-NLS-1$
		checkVersion(MultiPropertyConverter.class, "514283"); // $NON-NLS-1$
		checkVersion(SampleResultConverter.class, "571992"); // $NON-NLS-1$

        // Not built until later, so need to use this method:
        try {
            checkVersion(
                    Class.forName("org.apache.jmeter.protocol.http.util.HTTPResultConverter"), // $NON-NLS-1$
                    "514283"); // $NON-NLS-1$
        } catch (ClassNotFoundException e) {
            versionsOK = false;
            log.warn(e.getLocalizedMessage());
        }
		checkVersion(StringPropertyConverter.class, "493779"); // $NON-NLS-1$
		checkVersion(TestElementConverter.class, "549987"); // $NON-NLS-1$
		checkVersion(TestElementPropertyConverter.class, "549987"); // $NON-NLS-1$
		checkVersion(ScriptWrapperConverter.class, "514283"); // $NON-NLS-1$
		checkVersion(TestResultWrapperConverter.class, "514283"); // $NON-NLS-1$
        checkVersion(SampleSaveConfigurationConverter.class,"549936"); // $NON-NLS-1$

        if (!PROPVERSION.equalsIgnoreCase(propertiesVersion)) {
			log.warn("Bad _version - expected " + PROPVERSION + ", found " + propertiesVersion + ".");
		}
        if (!FILEVERSION.equalsIgnoreCase(fileVersion)) {
            log.warn("Bad _file_version - expected " + FILEVERSION + ", found " + fileVersion +".");
File
SaveService.java
Developer's decision
Version 2
Kind of conflict
Comment
If statement
Method invocation
Try statement
Chunk
Conflicting content
=======
		if (save.saveDataType())
			writer.addAttribute(ATT_DATA_TYPE, ConversionHelp.encode(res.getDataType()));
		if (save.saveEncoding())
<<<<<<< HEAD
			writer.addAttribute("de", ConversionHelp.encode(res.getDataEncoding()));
		if(save.saveContentLength())
		{
			writer.addAttribute("len", Integer.toString(res.getContentLength()));
		}
			writer.addAttribute(ATT_DATA_ENCODING, ConversionHelp.encode(res.getDataEncoding()));
		if (save.saveBytes())
			writer.addAttribute(ATT_BYTES, String.valueOf(res.getBytes()));
        if (save.saveThreadCounts()){// These cannot be restored
        	org.apache.jmeter.threads.ThreadGroup 
        	threadGroup=JMeterContextService.getContext().getThreadGroup();
        	int numThreads =0;
        	if (threadGroup != null) { // can be null for remote testing
        	    numThreads = threadGroup.getNumberOfThreads();
        	}
            writer.addAttribute(ATT_GRP_THRDS,
                    String.valueOf(numThreads));
            writer.addAttribute(ATT_ALL_THRDS,
                    String.valueOf(JMeterContextService.getNumberOfThreads()));
        }
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}

	/**
Solution content
		if (save.saveDataType())
			writer.addAttribute(ATT_DATA_TYPE, ConversionHelp.encode(res.getDataType()));
		if (save.saveEncoding())
			writer.addAttribute(ATT_DATA_ENCODING, ConversionHelp.encode(res.getDataEncoding()));
		if (save.saveBytes())
			writer.addAttribute(ATT_BYTES, String.valueOf(res.getBytes()));
        if (save.saveThreadCounts()){// These cannot be restored
        	org.apache.jmeter.threads.ThreadGroup 
        	threadGroup=JMeterContextService.getContext().getThreadGroup();
        	int numThreads =0;
        	if (threadGroup != null) { // can be null for remote testing
        	    numThreads = threadGroup.getNumberOfThreads();
        	}
            writer.addAttribute(ATT_GRP_THRDS,
                    String.valueOf(numThreads));
            writer.addAttribute(ATT_ALL_THRDS,
                    String.valueOf(JMeterContextService.getNumberOfThreads()));
        }
	}

	/**
File
SampleResultConverter.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
	 * @param res
	 */
	protected void retrieveAttributes(HierarchicalStreamReader reader, UnmarshallingContext context, SampleResult res) {
<<<<<<< HEAD
		res.setSampleLabel(ConversionHelp.decode(reader.getAttribute("lb")));
		res.setDataEncoding(ConversionHelp.decode(reader.getAttribute("de")));
		res.setDataType(ConversionHelp.decode(reader.getAttribute("dt")));
		res.setResponseCode(ConversionHelp.decode(reader.getAttribute("rc")));
		res.setResponseMessage(ConversionHelp.decode(reader.getAttribute("rm")));
		res.setSuccessful(Converter.getBoolean(reader.getAttribute("s"), true));
		res.setThreadName(ConversionHelp.decode(reader.getAttribute("tn")));
		res.setTime(Converter.getLong(reader.getAttribute("t")));
		res.setTimeStamp(Converter.getLong(reader.getAttribute("ts")));
		res.setLatency(Converter.getLong(reader.getAttribute("lt")));
		res.setContentLength(Converter.getInt(reader.getAttribute("len")));
=======
		res.setSampleLabel(ConversionHelp.decode(reader.getAttribute(ATT_LABEL)));
		res.setDataEncoding(ConversionHelp.decode(reader.getAttribute(ATT_DATA_ENCODING)));
		res.setDataType(ConversionHelp.decode(reader.getAttribute(ATT_DATA_TYPE)));
        String oldrc=reader.getAttribute(ATT_RESPONSE_CODE_OLD);
        if (oldrc!=null) {
            res.setResponseCode(ConversionHelp.decode(oldrc));
        } else {
            res.setResponseCode(ConversionHelp.decode(reader.getAttribute(ATT_RESPONSE_CODE)));
        }
		res.setResponseMessage(ConversionHelp.decode(reader.getAttribute(ATT_RESPONSE_MESSAGE)));
		res.setSuccessful(Converter.getBoolean(reader.getAttribute(ATT_SUCCESS), true));
		res.setThreadName(ConversionHelp.decode(reader.getAttribute(ATT_THREADNAME)));
		res.setStampAndTime(Converter.getLong(reader.getAttribute(ATT_TIME_STAMP)),
				Converter.getLong(reader.getAttribute(ATT_TIME)));
		res.setLatency(Converter.getLong(reader.getAttribute(ATT_LATENCY)));
		res.setBytes(Converter.getInt(reader.getAttribute(ATT_BYTES)));
        // ATT_GRP_THRDS and ATT_ALL_THRDS are write only
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}

    protected void readFile(String resultFileName, SampleResult res) {
Solution content
	 * @param res
	 */
	protected void retrieveAttributes(HierarchicalStreamReader reader, UnmarshallingContext context, SampleResult res) {
		res.setSampleLabel(ConversionHelp.decode(reader.getAttribute(ATT_LABEL)));
		res.setDataEncoding(ConversionHelp.decode(reader.getAttribute(ATT_DATA_ENCODING)));
		res.setDataType(ConversionHelp.decode(reader.getAttribute(ATT_DATA_TYPE)));
        String oldrc=reader.getAttribute(ATT_RESPONSE_CODE_OLD);
        if (oldrc!=null) {
            res.setResponseCode(ConversionHelp.decode(oldrc));
        } else {
            res.setResponseCode(ConversionHelp.decode(reader.getAttribute(ATT_RESPONSE_CODE)));
        }
		res.setResponseMessage(ConversionHelp.decode(reader.getAttribute(ATT_RESPONSE_MESSAGE)));
		res.setSuccessful(Converter.getBoolean(reader.getAttribute(ATT_SUCCESS), true));
		res.setThreadName(ConversionHelp.decode(reader.getAttribute(ATT_THREADNAME)));
		res.setStampAndTime(Converter.getLong(reader.getAttribute(ATT_TIME_STAMP)),
				Converter.getLong(reader.getAttribute(ATT_TIME)));
		res.setLatency(Converter.getLong(reader.getAttribute(ATT_LATENCY)));
		res.setBytes(Converter.getInt(reader.getAttribute(ATT_BYTES)));
        // ATT_GRP_THRDS and ATT_ALL_THRDS are write only
	}

    protected void readFile(String resultFileName, SampleResult res) {
File
SampleResultConverter.java
Developer's decision
Version 2
Kind of conflict
Comment
If statement
Method invocation
Variable
Chunk
Conflicting content
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
<<<<<<< HEAD
import java.io.PrintWriter;
=======
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
import java.io.Reader;
import java.io.Writer;
import java.util.Collections;
Solution content
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
File
FileServer.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
public class FileServer {
	private static final Logger log = LoggingManager.getLoggerForClass();

<<<<<<< HEAD
	Map files = Collections.synchronizedMap(new HashMap());
=======
    private static final String DEFAULT_BASE = JMeterUtils.getProperty("user.dir");
    
	private File base;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

    //TODO - make "files" and "random" static as the class is a singleton?
    
Solution content
public class FileServer {
	private static final Logger log = LoggingManager.getLoggerForClass();

    private static final String DEFAULT_BASE = JMeterUtils.getProperty("user.dir");
    
	private File base;

    //TODO - make "files" and "random" static as the class is a singleton?
    
File
FileServer.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
    public void resetBase() throws IOException{
		return server;
	}

<<<<<<< HEAD
	public void setBasedir(String basedir) throws IOException {
=======
        setBasedir(DEFAULT_BASE);
    }
    
	public synchronized void setBasedir(String basedir) throws IOException {
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		if (filesOpen()) {
			throw new IOException("Files are still open, cannot change base directory");
		}
Solution content
		return server;
	}

    public void resetBase() throws IOException{
        setBasedir(DEFAULT_BASE);
    }
    
	public synchronized void setBasedir(String basedir) throws IOException {
		if (filesOpen()) {
			throw new IOException("Files are still open, cannot change base directory");
		}
File
FileServer.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Method signature
Chunk
Conflicting content
     * @param filename - relative (to base) or absolute file name
     */
	public synchronized void reserveFile(String filename) {
<<<<<<< HEAD
		if (!files.containsKey(filename)) {
			Object[] file = new Object[2];
			file[0] = new File(base,filename);
			if(!((File)file[0]).exists() && !((File)file[0]).getParentFile().exists())
			{
				file[0] = new File(filename);
			}
=======
		reserveFile(filename,null);
	}

    /**
     * Creates an association between a filename and a File inputOutputObject,
     * and stores it for later use - unless it is already stored.
     * 
     * @param filename - relative (to base) or absolute file name
     * @param charsetName - the character set encoding to use for the file
     */
	public synchronized void reserveFile(String filename, String charsetName) {
		if (!files.containsKey(filename)) {
            File f = new File(filename); 
            FileEntry file = 
                new FileEntry(f.isAbsolute() ? f : new File(base, filename),null,charsetName);
            log.info("Stored: "+filename);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
			files.put(filename, file);
		}
	}
Solution content
     * @param filename - relative (to base) or absolute file name
     */
	public synchronized void reserveFile(String filename) {
		reserveFile(filename,null);
	}

    /**
     * Creates an association between a filename and a File inputOutputObject,
     * and stores it for later use - unless it is already stored.
     * 
     * @param filename - relative (to base) or absolute file name
     * @param charsetName - the character set encoding to use for the file
     */
	public synchronized void reserveFile(String filename, String charsetName) {
		if (!files.containsKey(filename)) {
            File f = new File(filename); 
            FileEntry file = 
                new FileEntry(f.isAbsolute() ? f : new File(base, filename),null,charsetName);
            log.info("Stored: "+filename);
			files.put(filename, file);
		}
	}
File
FileServer.java
Developer's decision
Version 2
Kind of conflict
Array access
Comment
If statement
Method invocation
Method signature
Variable
Chunk
Conflicting content
	 * @return String containing the next line in the file (null if EOF reached and not recycle)
	 * @throws IOException
	 */
<<<<<<< HEAD
	public String readLine(String filename) throws IOException {
		Object[] file = getFileObjects(filename);
		synchronized(file)
		{
			if (file != null) {
				if (file[1] == null) {
					BufferedReader r = new BufferedReader(new FileReader((File) file[0]));
					file[1] = r;
				}
				BufferedReader reader = (BufferedReader) file[1];
				String line = reader.readLine();
				if (line == null) {
					reader.close();
					reader = new BufferedReader(new FileReader((File) file[0]));
					file[1] = reader;
					line = reader.readLine();
				}
				return line;
			}
=======
	public synchronized String readLine(String filename, boolean recycle) throws IOException {
		FileEntry fileEntry = (FileEntry) files.get(filename);
		if (fileEntry != null) {
			if (fileEntry.inputOutputObject == null) {
				fileEntry.inputOutputObject = createBufferedReader(fileEntry, filename);
            } else if (!(fileEntry.inputOutputObject instanceof Reader)) {
                throw new IOException("File " + filename + " already in use");
            }
			BufferedReader reader = (BufferedReader) fileEntry.inputOutputObject;
			String line = reader.readLine();
			if (line == null && recycle) {
				reader.close();
				reader = createBufferedReader(fileEntry, filename);
				fileEntry.inputOutputObject = reader;
				line = reader.readLine();
			}
            if (log.isDebugEnabled()) log.debug("Read:"+line);
			return line;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		}
		throw new IOException("File never reserved: "+filename);
	}
Solution content
	 * @return String containing the next line in the file (null if EOF reached and not recycle)
	 * @throws IOException
	 */
	public synchronized String readLine(String filename, boolean recycle) throws IOException {
		FileEntry fileEntry = (FileEntry) files.get(filename);
		if (fileEntry != null) {
			if (fileEntry.inputOutputObject == null) {
				fileEntry.inputOutputObject = createBufferedReader(fileEntry, filename);
            } else if (!(fileEntry.inputOutputObject instanceof Reader)) {
                throw new IOException("File " + filename + " already in use");
            }
			BufferedReader reader = (BufferedReader) fileEntry.inputOutputObject;
			String line = reader.readLine();
			if (line == null && recycle) {
				reader.close();
				reader = createBufferedReader(fileEntry, filename);
				fileEntry.inputOutputObject = reader;
				line = reader.readLine();
			}
            if (log.isDebugEnabled()) log.debug("Read:"+line);
			return line;
		}
		throw new IOException("File never reserved: "+filename);
	}
File
FileServer.java
Developer's decision
Version 2
Kind of conflict
Cast expression
If statement
Method invocation
Method signature
Return statement
Synchronized statement
Variable
Chunk
Conflicting content
		}
		return new BufferedReader(isr);
	}
<<<<<<< HEAD
	
	protected Object[] getFileObjects(String filename)
	{
		}
		Object[] file = (Object[]) files.get(filename);
		if(file == null)
		{
			reserveFile(filename);
			file = (Object[]) files.get(filename);
		return file;		
	}

	public void write(String filename, String value) throws IOException {
		Object[] file = getFileObjects(filename);
		synchronized(file)
		{
			if (file != null) {
				if (file[1] == null) {
					file[1] = new PrintWriter((File) file[0],"utf-8");
				} else if (!(file[1] instanceof Writer)) {
					throw new IOException("File " + filename + " already in use for reading");
				}
				PrintWriter writer = (PrintWriter) file[1];
				writer.write(value);
			}
=======

	public synchronized void write(String filename, String value) throws IOException {
		FileEntry fileEntry = (FileEntry) files.get(filename);
		if (fileEntry != null) {
			if (fileEntry.inputOutputObject == null) {
				fileEntry.inputOutputObject = createBufferedWriter(fileEntry, filename);
			} else if (!(fileEntry.inputOutputObject instanceof Writer)) {
				throw new IOException("File " + filename + " already in use");
			}
			BufferedWriter writer = (BufferedWriter) fileEntry.inputOutputObject;
            if (log.isDebugEnabled()) log.debug("Write:"+value);
			writer.write(value);
		} else {
            throw new IOException("File never reserved: "+filename);      
        }
	}

	private BufferedWriter createBufferedWriter(FileEntry fileEntry, String filename) throws IOException { 
		FileOutputStream fos = new FileOutputStream(fileEntry.file);				
		OutputStreamWriter osw = null;
        // If file encoding is specified, write using that encoding, otherwise use default platform encoding
		String charsetName = fileEntry.charSetEncoding;
		if(charsetName != null && charsetName.trim().length() > 0) {
			osw = new OutputStreamWriter(fos, charsetName); 
		} else {
			osw = new OutputStreamWriter(fos); 
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		}
		return new BufferedWriter(osw);
	}
Solution content
		}
		return new BufferedReader(isr);
	}

	public synchronized void write(String filename, String value) throws IOException {
		FileEntry fileEntry = (FileEntry) files.get(filename);
		if (fileEntry != null) {
			if (fileEntry.inputOutputObject == null) {
				fileEntry.inputOutputObject = createBufferedWriter(fileEntry, filename);
			} else if (!(fileEntry.inputOutputObject instanceof Writer)) {
				throw new IOException("File " + filename + " already in use");
			}
			BufferedWriter writer = (BufferedWriter) fileEntry.inputOutputObject;
            if (log.isDebugEnabled()) log.debug("Write:"+value);
			writer.write(value);
		} else {
            throw new IOException("File never reserved: "+filename);      
        }
	}

	private BufferedWriter createBufferedWriter(FileEntry fileEntry, String filename) throws IOException { 
		FileOutputStream fos = new FileOutputStream(fileEntry.file);				
		OutputStreamWriter osw = null;
        // If file encoding is specified, write using that encoding, otherwise use default platform encoding
		String charsetName = fileEntry.charSetEncoding;
		if(charsetName != null && charsetName.trim().length() > 0) {
			osw = new OutputStreamWriter(fos, charsetName); 
		} else {
			osw = new OutputStreamWriter(fos); 
		}
		return new BufferedWriter(osw);
	}
File
FileServer.java
Developer's decision
Version 2
Kind of conflict
Comment
If statement
Method declaration
Method invocation
Method signature
Synchronized statement
Variable
Chunk
Conflicting content
	 * @param name
	 * @throws IOException
	 */
<<<<<<< HEAD
	public void closeFile(String name) throws IOException {
		Object[] file = (Object[]) files.get(name);
		synchronized(file)
		{
			if (file != null && file.length == 2 && file[1] != null) {
				((Reader) file[1]).close();
				file[1] = null;
			}
		}
=======
	public synchronized void closeFile(String name) throws IOException {
		FileEntry fileEntry = (FileEntry) files.get(name);
		closeFile(name, fileEntry);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}

    private void closeFile(String name, FileEntry fileEntry) throws IOException {
Solution content
	 * @param name
	 * @throws IOException
	 */
	public synchronized void closeFile(String name) throws IOException {
		FileEntry fileEntry = (FileEntry) files.get(name);
		closeFile(name, fileEntry);
	}

    private void closeFile(String name, FileEntry fileEntry) throws IOException {
File
FileServer.java
Developer's decision
Version 2
Kind of conflict
Cast expression
Method invocation
Method signature
Synchronized statement
Variable
Chunk
Conflicting content
	public static final String NOT_OTHER = "notOther"; //$NON-NLS-1$

<<<<<<< HEAD
	public static final String DEFAULT = "default";
	
	public static final String MULTILINE = "multiline";
=======
	public static final String DEFAULT = "default"; //$NON-NLS-1$
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

	public static final String RESOURCE_BUNDLE = "resourceBundle"; //$NON-NLS-1$
Solution content
	public static final String NOT_OTHER = "notOther"; //$NON-NLS-1$

	public static final String DEFAULT = "default"; //$NON-NLS-1$

	public static final String RESOURCE_BUNDLE = "resourceBundle"; //$NON-NLS-1$
File
GenericTestBeanCustomizer.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
	}

	// Dummy for JUnit test
<<<<<<< HEAD
	TestBeanGUI() {
		log.warn("Only for use in testing");
=======
	public TestBeanGUI() {
		log.warn("Constructor only for use in testing");// $NON-NLS-1$
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}

	public TestBeanGUI(Class testBeanClass) {
Solution content
	}

	// Dummy for JUnit test
	public TestBeanGUI() {
		log.warn("Constructor only for use in testing");// $NON-NLS-1$
	}

	public TestBeanGUI(Class testBeanClass) {
File
TestBeanGUI.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Method signature
Chunk
Conflicting content
<<<<<<< HEAD
	}
		this.threadName = inthreadName;

>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	/**
	 * 
	 */
=======
	public AbstractTestElement() {
		super();
	}
Solution content
		this.threadName = inthreadName;
	}

	public AbstractTestElement() {
		super();
	}
File
AbstractTestElement.java
Developer's decision
Version 2
Kind of conflict
Comment
Chunk
Conflicting content
    }
    
	private void threadStarted() {
<<<<<<< HEAD
        processThreadListeners(true);
=======
		ThreadListenerTraverser startup = new ThreadListenerTraverser(true);
		testTree.traverse(startup);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}

	private void threadFinished() {
Solution content
	private void threadStarted() {
		ThreadListenerTraverser startup = new ThreadListenerTraverser(true);
		testTree.traverse(startup);
	}

	/**
	 * 
	 */
	private void threadFinished() {
File
JMeterThread.java
Developer's decision
Manual
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
	}

	private void threadFinished() {
<<<<<<< HEAD
        processThreadListeners(false);
=======
		ThreadListenerTraverser shut = new ThreadListenerTraverser(false);
		testTree.traverse(shut);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		JMeterContextService.decrNumberOfThreads();
        threadGroup.decrNumberOfThreads();
        GuiPackage gp = GuiPackage.getInstance();
Solution content
	}

	/**
	 * 
	 */
	private void threadFinished() {
		ThreadListenerTraverser shut = new ThreadListenerTraverser(false);
		testTree.traverse(shut);
		JMeterContextService.decrNumberOfThreads();
        threadGroup.decrNumberOfThreads();
        GuiPackage gp = GuiPackage.getInstance();
File
JMeterThread.java
Developer's decision
Manual
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
        }
	}

<<<<<<< HEAD
=======
	private static class ThreadListenerTraverser implements HashTreeTraverser {
		private boolean isStart = false;

		private ThreadListenerTraverser(boolean start) {
			isStart = start;
		}

		public void addNode(Object node, HashTree subTree) {
			if (node instanceof ThreadListener) {
				ThreadListener tl = (ThreadListener) node;
				if (isStart) {
					tl.threadStarted();
				} else {
					tl.threadFinished();
				}
			}
		}

		public void subtractNode() {
		}

		public void processPath() {
		}
	}

>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	public String getThreadName() {
		return threadName;
	}
Solution content
        }
	}

	private static class ThreadListenerTraverser implements HashTreeTraverser {
		private boolean isStart = false;

		private ThreadListenerTraverser(boolean start) {
			isStart = start;
		}

		public void addNode(Object node, HashTree subTree) {
			if (node instanceof ThreadListener) {
				ThreadListener tl = (ThreadListener) node;
				if (isStart) {
					tl.threadStarted();
				} else {
					tl.threadFinished();
				}
			}
		}

		public void subtractNode() {
		}

		public void processPath() {
		}
	}

	public String getThreadName() {
		return threadName;
	}
File
JMeterThread.java
Developer's decision
Version 2
Kind of conflict
Class declaration
Chunk
Conflicting content
	public JPopupMenu createPopupMenu() {
		JPopupMenu pop = new JPopupMenu();
<<<<<<< HEAD
		pop.add(MenuFactory.makeMenus(new String[] { MenuFactory.CONTROLLERS, MenuFactory.LISTENERS,
				MenuFactory.SAMPLERS, MenuFactory.ASSERTIONS,MenuFactory.TIMERS, MenuFactory.CONFIG_ELEMENTS, MenuFactory.PRE_PROCESSORS,
				MenuFactory.POST_PROCESSORS }, JMeterUtils.getResString("Add"), "Add"));
=======
		pop.add(MenuFactory.makeMenus(new String[] { 
				MenuFactory.CONTROLLERS, 
				MenuFactory.LISTENERS,
				MenuFactory.SAMPLERS, 
				MenuFactory.ASSERTIONS,
				MenuFactory.TIMERS, 
				MenuFactory.CONFIG_ELEMENTS, 
				MenuFactory.PRE_PROCESSORS,
				MenuFactory.POST_PROCESSORS }, 
				JMeterUtils.getResString("add"), // $NON-NLS-1$
				ActionNames.ADD));
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		MenuFactory.addEditMenu(pop, true);
		MenuFactory.addFileMenu(pop);
		return pop;
Solution content
	public JPopupMenu createPopupMenu() {
		JPopupMenu pop = new JPopupMenu();
		pop.add(MenuFactory.makeMenus(new String[] { 
				MenuFactory.CONTROLLERS, 
				MenuFactory.LISTENERS,
				MenuFactory.SAMPLERS, 
				MenuFactory.ASSERTIONS,
				MenuFactory.TIMERS, 
				MenuFactory.CONFIG_ELEMENTS, 
				MenuFactory.PRE_PROCESSORS,
				MenuFactory.POST_PROCESSORS }, 
				JMeterUtils.getResString("add"), // $NON-NLS-1$
				ActionNames.ADD));
		MenuFactory.addEditMenu(pop, true);
		MenuFactory.addFileMenu(pop);
		return pop;
File
ThreadGroupGui.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
package org.apache.jmeter.util;

import java.awt.Dimension;
<<<<<<< HEAD
import java.awt.Image;
=======
import java.awt.HeadlessException;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
Solution content
package org.apache.jmeter.util;

import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
File
JMeterUtils.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
	 * This ensures that JMeterUtils always gets the correct
	 * version, even if JMeterUtils is not re-compiled during the build.
	 */
<<<<<<< HEAD
	private static final String VERSION = "2.1.20050824";
=======
	private static final String VERSION = "2.3.20070909";
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

	static final String COPYRIGHT = "Copyright (c) 1998-2007 The Apache Software Foundation";
Solution content
	 * This ensures that JMeterUtils always gets the correct
	 * version, even if JMeterUtils is not re-compiled during the build.
	 */
	private static final String VERSION = "2.3.20070909";

	static final String COPYRIGHT = "Copyright (c) 1998-2007 The Apache Software Foundation";
File
JMeterVersion.java
Developer's decision
Version 2
Kind of conflict
Attribute
Chunk
Conflicting content
<<<<<<< HEAD
		Sample s = null;
	 * 
	 */
	public Sample addSample(SampleResult res) {
		synchronized (calculator) {
			long byteslength = 0;
			// in case the sampler doesn't return the contents
			// we see if the bytes was set
			byteslength = res.getContentLength();
=======
        long rtime, cmean, cstdv, cmedian, cpercent, eCount, endTime;
        double throughput;
        boolean rbool;
        synchronized (calculator) {
			long byteslength = res.getBytes();
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
			// if there was more than 1 loop in the sample, we
			// handle it appropriately
			if (res.getSampleCount() > 1) {
Solution content
	public Sample addSample(SampleResult res) {
	 * 
	 */
        long rtime, cmean, cstdv, cmedian, cpercent, eCount, endTime;
        double throughput;
        boolean rbool;
        synchronized (calculator) {
			long byteslength = res.getBytes();
			// if there was more than 1 loop in the sample, we
			// handle it appropriately
			if (res.getSampleCount() > 1) {
File
SamplingStatCalculator.java
Developer's decision
Version 2
Kind of conflict
Synchronized statement
Variable
Chunk
Conflicting content
		return (Class) classes.get(arg0);
	}
	
<<<<<<< HEAD
	public List getObjectList()
	{
		return objects;
	}

=======
	/**
	 * Check all registered functors.
	 * 

* ** only for use in unit test code ** *

* * @param _value - an instance of the table model row data item * (if null, use the class passed to the constructor). * * @param caller - class of caller. * * @return false if at least one Functor cannot be found. */ public boolean checkFunctors(Object _value, Class caller){ Object value; if (_value == null && objectClass != null) { try { value = objectClass.newInstance(); } catch (InstantiationException e) { log.error("Cannot create instance of class "+objectClass.getName(),e); return false; } catch (IllegalAccessException e) { log.error("Cannot create instance of class "+objectClass.getName(),e); return false; } } else { value = _value; } boolean status = true; for(int i=0;i>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9 }
Solution content
		return (Class) classes.get(arg0);
	}
	
	/**
	 * Check all registered functors.
	 * 

* ** only for use in unit test code ** *

* * @param _value - an instance of the table model row data item * (if null, use the class passed to the constructor). * * @param caller - class of caller. * * @return false if at least one Functor cannot be found. */ public boolean checkFunctors(Object _value, Class caller){ Object value; if (_value == null && objectClass != null) { try { value = objectClass.newInstance(); } catch (InstantiationException e) { log.error("Cannot create instance of class "+objectClass.getName(),e); return false; } catch (IllegalAccessException e) { log.error("Cannot create instance of class "+objectClass.getName(),e); return false; } } else { value = _value; } boolean status = true; for(int i=0;i
File
ObjectTableModel.java
Developer's decision
Version 2
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
		}
        final String EMPTY_ELEMENT = "";
		int spot;
<<<<<<< HEAD
        if(truncate) {
    		while ((spot = splittee.indexOf(splitChar + splitChar)) != -1) {
    			splittee = splittee.substring(0, spot + splitChar.length())
    					+ splittee.substring(spot + 2 * splitChar.length(), splittee.length());
    		}
            if(splittee.startsWith(splitChar)) splittee = splittee.substring(splitChar.length());
=======
        final int splitLength = splitChar.length();
        final String adjacentSplit = splitChar + splitChar;
        final int adjacentSplitLength = adjacentSplit.length();
        if(truncate) {
            while ((spot = splittee.indexOf(adjacentSplit)) != -1) {
    			splittee = splittee.substring(0, spot + splitLength)
    					+ splittee.substring(spot + adjacentSplitLength, splittee.length());
    		}
            if(splittee.startsWith(splitChar)) splittee = splittee.substring(splitLength);
            if(splittee.endsWith(splitChar)) // Remove trailing splitter
                splittee = splittee.substring(0,splittee.length()-splitLength);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
        }
		Vector returns = new Vector();
        final int length = splittee.length(); // This is the new length
Solution content
		}
        final String EMPTY_ELEMENT = "";
		int spot;
        final int splitLength = splitChar.length();
        final String adjacentSplit = splitChar + splitChar;
        final int adjacentSplitLength = adjacentSplit.length();
        if(truncate) {
            while ((spot = splittee.indexOf(adjacentSplit)) != -1) {
    			splittee = splittee.substring(0, spot + splitLength)
    					+ splittee.substring(spot + adjacentSplitLength, splittee.length());
    		}
            if(splittee.startsWith(splitChar)) splittee = splittee.substring(splitLength);
            if(splittee.endsWith(splitChar)) // Remove trailing splitter
                splittee = splittee.substring(0,splittee.length()-splitLength);
        }
		Vector returns = new Vector();
        final int length = splittee.length(); // This is the new length
File
JOrphanUtils.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Variable
While statement
Chunk
Conflicting content
			}
            else
            {
<<<<<<< HEAD
                returns.addElement("");
            }
			start = spot + splitChar.length();
=======
                returns.addElement(EMPTY_ELEMENT);
            }
			start = spot + splitLength;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		}
		if (start < length) {
			returns.add(splittee.substring(start));
Solution content
			}
            else
            {
                returns.addElement(EMPTY_ELEMENT);
            }
			start = spot + splitLength;
		}
		if (start < length) {
			returns.add(splittee.substring(start));
File
JOrphanUtils.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
        return split(splittee,splitChar,true);
    }

<<<<<<< HEAD
	private static final String SPACES = "                                 ";
=======
    /**
     * Takes a String and a tokenizer character string, and returns a new array of
     * strings of the string split by the tokenizer character(s).
     * 
     * Trailing delimiters are significant (unless the default = null)
     *  
     * @param splittee
     *            String to be split.
     * @param delims
     *            Delimiter character(s) to split the string on
     * @param def
     *            Default value to place between two split chars that have
     *            nothing between them. If null, then ignore omitted elements.
     *
     * @return Array of all the tokens.
     * 
     * @throws NullPointerException if splittee or delims are null
     * 
     * @see #split(String, String, boolean)
     * @see #split(String, String)
     * 
     * This is a rewritten version of JMeterUtils.split()
     */
    public static String[] split(String splittee, String delims, String def) {
        StringTokenizer tokens = new StringTokenizer(splittee,delims,def!=null);
        boolean lastWasDelim=false;
        List strList=new ArrayList();
        while (tokens.hasMoreTokens()) {
            String tok=tokens.nextToken();
            if (   tok.length()==1 // we have a single character; could be a token 
                && delims.indexOf(tok)!=-1) // it is a token
            {
                if (lastWasDelim) {// we saw a delimiter last time
                    strList.add(def);// so add the default
                }
                lastWasDelim=true;
            } else {
                lastWasDelim=false;
                strList.add(tok);
            }
        }
        if (lastWasDelim) {
            strList.add(def);
        }
        return (String[])strList.toArray(new String[0]);
    }
    
    
    private static final String SPACES = "                                 ";
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

	private static final int SPACES_LEN = SPACES.length();
Solution content
        return split(splittee,splitChar,true);
    }

    /**
     * Takes a String and a tokenizer character string, and returns a new array of
     * strings of the string split by the tokenizer character(s).
     * 
     * Trailing delimiters are significant (unless the default = null)
     *  
     * @param splittee
     *            String to be split.
     * @param delims
     *            Delimiter character(s) to split the string on
     * @param def
     *            Default value to place between two split chars that have
     *            nothing between them. If null, then ignore omitted elements.
     *
     * @return Array of all the tokens.
     * 
     * @throws NullPointerException if splittee or delims are null
     * 
     * @see #split(String, String, boolean)
     * @see #split(String, String)
     * 
     * This is a rewritten version of JMeterUtils.split()
     */
    public static String[] split(String splittee, String delims, String def) {
        StringTokenizer tokens = new StringTokenizer(splittee,delims,def!=null);
        boolean lastWasDelim=false;
        List strList=new ArrayList();
        while (tokens.hasMoreTokens()) {
            String tok=tokens.nextToken();
            if (   tok.length()==1 // we have a single character; could be a token 
                && delims.indexOf(tok)!=-1) // it is a token
            {
                if (lastWasDelim) {// we saw a delimiter last time
                    strList.add(def);// so add the default
                }
                lastWasDelim=true;
            } else {
                lastWasDelim=false;
                strList.add(tok);
            }
        }
        if (lastWasDelim) {
            strList.add(def);
        }
        return (String[])strList.toArray(new String[0]);
    }
    
    
    private static final String SPACES = "                                 ";

	private static final int SPACES_LEN = SPACES.length();
File
JOrphanUtils.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method declaration
Chunk
Conflicting content
		return slice;
	}
<<<<<<< HEAD
=======

    /**
     * close a stream with no error thrown
     * @param is - InputStream (may be null)
     */
    public static void closeQuietly(InputStream is){
        try {
            if (is != null) is.close();
        } catch (IOException e) {
        }
    }

    /**
     * close a stream with no error thrown
     * @param os - OutputStream (may be null)
     */
    public static void closeQuietly(OutputStream os){
        try {
            if (os != null) os.close();
        } catch (IOException e) {
        }
    }

    /**
     * close a Writer with no error thrown
     * @param wr - Writer (may be null)
     */
    public static void closeQuietly(Writer wr){
        try {
            if (wr != null) wr.close();
        } catch (IOException e) {
        }
    }

    /**
     * close a Reader with no error thrown
     * @param rd - Reader (may be null)
     */
    public static void closeQuietly(Reader rd){
        try {
            if (rd != null) rd.close();
        } catch (IOException e) {
        }
    }

    /**
     * close a Socket with no error thrown
     * @param sock - Socket (may be null)
     */
    public static void closeQuietly(Socket sock){
        try {
            if (sock!= null) sock.close();
        } catch (IOException e) {
        }
    }

    /**
     * close a Socket with no error thrown
     * @param sock - ServerSocket (may be null)
     */
    public static void closeQuietly(ServerSocket sock){
        try {
            if (sock!= null) sock.close();
        } catch (IOException e) {
        }
    }
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
}
Solution content
}

		return slice;
	}

    /**
     * close a stream with no error thrown
     * @param is - InputStream (may be null)
     */
    public static void closeQuietly(InputStream is){
        try {
            if (is != null) is.close();
        } catch (IOException e) {
        }
    }

    /**
     * close a stream with no error thrown
     * @param os - OutputStream (may be null)
     */
    public static void closeQuietly(OutputStream os){
        try {
            if (os != null) os.close();
        } catch (IOException e) {
        }
    }

    /**
     * close a Writer with no error thrown
     * @param wr - Writer (may be null)
     */
    public static void closeQuietly(Writer wr){
        try {
            if (wr != null) wr.close();
        } catch (IOException e) {
        }
    }

    /**
     * close a Reader with no error thrown
     * @param rd - Reader (may be null)
     */
    public static void closeQuietly(Reader rd){
        try {
            if (rd != null) rd.close();
        } catch (IOException e) {
        }
    }

    /**
     * close a Socket with no error thrown
     * @param sock - Socket (may be null)
     */
    public static void closeQuietly(Socket sock){
        try {
            if (sock!= null) sock.close();
        } catch (IOException e) {
        }
    }

    /**
     * close a Socket with no error thrown
     * @param sock - ServerSocket (may be null)
     */
    public static void closeQuietly(ServerSocket sock){
        try {
            if (sock!= null) sock.close();
        } catch (IOException e) {
        }
    }
File
JOrphanUtils.java
Developer's decision
Version 2
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
    private static String PATH_SPECIFIED = "Cookie.path_specified"; //$NON-NLS-1$

<<<<<<< HEAD
	private static String PATH = "Cookie.path";
	
	private static String PORT = "Cookie.port";
=======
    private static String DOMAIN_SPECIFIED = "Cookie.domain_specified"; //$NON-NLS-1$
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

	/**
	 * create the coookie
Solution content
	/**
	 * create the coookie

    private static String PATH_SPECIFIED = "Cookie.path_specified"; //$NON-NLS-1$

    private static String DOMAIN_SPECIFIED = "Cookie.domain_specified"; //$NON-NLS-1$
File
Cookie.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
	/**
	 * Return the cookie at index i.
	 */
<<<<<<< HEAD
	public Cookie get(int i) {
		return (Cookie) getCookies().get(i);
	}

	public String convertLongToDateFormatStr(long dateLong) {
		return dateFormat.format(new Date(dateLong));
	}

	/**
	 * Find cookies applicable to the given URL and build the Cookie header from
	 * them.
	 * 
	 * @param url
	 *            URL of the request to which the returned header will be added.
	 * @return the value string for the cookie header (goes after "Cookie: ").
	 */
	public String getCookieHeaderForURL(URL url) {
		boolean debugEnabled = log.isDebugEnabled();
		if (debugEnabled)
			log.debug("Get cookie for URL= " + url);
		if (!url.getProtocol().toUpperCase().trim().equals("HTTP")
				&& !url.getProtocol().toUpperCase().trim().equals("HTTPS"))
			return null;

		StringBuffer header = new StringBuffer();
		String host = "." + url.getHost();
		if (debugEnabled)
			log.debug("URL Host=" + host);
		if (debugEnabled)
			log.debug("Time now (secs)" + (System.currentTimeMillis() / 1000));
		for (PropertyIterator iter = getCookies().iterator(); iter.hasNext();) {
			Cookie cookie = (Cookie) iter.next().getObjectValue();
			// Add a leading dot to the host name so that host X matches
			// domain .X. This is a breach of the standard, but it's how
			// browsers behave:
			if (debugEnabled) {
				log.debug("Cookie name=" + cookie.getName() + " domain=" + cookie.getDomain() + " path="
						+ cookie.getPath() + " expires=" + cookie.getExpires());
			}
			if (host.endsWith(cookie.getDomain()) && url.getFile().startsWith(cookie.getPath())
					&& ((cookie.getExpires() == 0 && // treat as never expiring
					(cookie.getPort() == 0 || cookie.getPort() == url.getPort())) 
													// (bug 27713)
					|| (System.currentTimeMillis() / 1000) <= cookie.getExpires())) {
				if (header.length() > 0) {
					header.append("; ");
				}
				if (debugEnabled)
					log.debug("matched cookie, value = " + cookie.getValue());
				header.append(cookie.getName()).append("=").append(cookie.getValue());
			}
		}

		if (header.length() != 0) {
			if (debugEnabled)
				log.debug(header.toString());
			return header.toString();
		} else {
			return null;
		}
	}

	/**
	 * Parse the set-cookie header value and store the cookies for later
	 * retrieval.
	 * 
	 * @param cookieHeader
	 *            found after the "Set-Cookie: " in the response header
	 * @param url
	 *            URL used in the request for the above-mentioned response.
	 */
	public void addCookieFromHeader(String cookieHeader, URL url) {
		if (log.isDebugEnabled()) {
			log.debug("addCookieFromHeader(" + cookieHeader + "," + url.toExternalForm() + ")");
		}
		StringTokenizer st = new StringTokenizer(cookieHeader, ";");
		String nvp;

		// first n=v is name=value
		nvp = st.nextToken();
		int index = nvp.indexOf("=");
		String name = nvp.substring(0, index);
		String value = nvp.substring(index + 1);
		String domain = "." + url.getHost(); // this is the default
		// the leading dot breaks the standard, but helps in
		// reproducing actual browser behaviour.
		// The default is the path of the reques URL
		String path = url.getPath();
		if (path.length() == 0)
			path = "/"; // default if no path specified

		Cookie newCookie = new Cookie(name, value, domain, path, false, 0); // No
																			// expiry
																			// means
																			// session
																			// cookie
		newCookie.setPort(url.getPort());
		// check the rest of the headers
		while (st.hasMoreTokens()) {
			nvp = st.nextToken();
			nvp = nvp.trim();
			index = nvp.indexOf("=");
			if (index == -1) {
				index = nvp.length();
			}
			String key = nvp.substring(0, index);
			if (key.equalsIgnoreCase("expires")) {
				try {
					String expires = nvp.substring(index + 1);
					Date date = dateFormat.parse(expires);
					// Always set expiry date - see Bugzilla id 29493
					newCookie.setExpires(date.getTime() / 1000); // Set time
																	// in
																	// seconds
				} catch (ParseException pe) {
					// This means the cookie did not come in the proper format.
					// Log an error and don't set an expiration time:
					log.error("Couldn't parse Cookie expiration time.", pe);
				} catch (Exception e) {
					// DateFormat.parse() has been known to throw various
					// unchecked exceptions in the past, and does still do that
					// occasionally at the time of this writing (1.4.2 JDKs).
					// E.g. see
					// http://developer.java.sun.com/developer/bugParade/bugs/4699765.html
					//
					// As a workaround for such issues we will catch all
					// exceptions and react just as we did for ParseException
					// above:
					log.error("Couln't parse Cookie expiration time: likely JDK bug.", e);
				}
			} else if (key.equalsIgnoreCase("domain")) {
				// trim() is a workaround for bug in Oracle8iAS wherere
				// cookies would have leading spaces in the domain portion
				domain = nvp.substring(index + 1).trim();

				// The standard dictates domains must have a leading dot,
				// but the new standard (Cookie2) tells us to add it if it's not
				// there:
				if (!domain.startsWith(".")) {
					domain = "." + domain;
				}

				newCookie.setDomain(domain);
			} else if (key.equalsIgnoreCase("path")) {
				newCookie.setPath(nvp.substring(index + 1).trim());
			} else if (key.equalsIgnoreCase("secure")) {
				newCookie.setSecure(true);
			}
		}

		Vector removeIndices = new Vector();
		for (int i = getCookies().size() - 1; i >= 0; i--) {
			Cookie cookie = (Cookie) getCookies().get(i).getObjectValue();
			if (cookie == null)
				continue;
			if (cookie.getPath().equals(newCookie.getPath()) && cookie.getDomain().equals(newCookie.getDomain())
					&& cookie.getName().equals(newCookie.getName())) {
				if (log.isDebugEnabled()) {
					log
							.debug("New Cookie = " + newCookie.toString() + " removing matching Cookie "
									+ cookie.toString());
				}
				removeIndices.addElement(new Integer(i));
			}
		}

		for (Enumeration e = removeIndices.elements(); e.hasMoreElements();) {
			index = ((Integer) e.nextElement()).intValue();
			remove(index);
		}

		long exp = newCookie.getExpires();
		// Store session cookies as well as unexpired ones
		if (exp == 0 || exp >= System.currentTimeMillis() / 1000) {
			add(newCookie);
		}
	}

	public void removeCookieNamed(String name) {
		if (log.isDebugEnabled())
			log.debug("Remove cookie named " + name);
		PropertyIterator iter = getCookies().iterator();
		while (iter.hasNext()) {
			Cookie cookie = (Cookie) iter.next().getObjectValue();
			if (cookie.getName().equals(name)) {
				iter.remove();
			}
		}
	}

	/**
	 * Takes a String and a tokenizer character, and returns a new array of
	 * strings of the string split by the tokenizer character.
	 * 
	 * @param splittee
	 *            string to be split
	 * @param splitChar
	 *            character to split the string on
	 * @param def
	 *            default value to place between two split chars that have
	 *            nothing between them
	 * @return array of all the tokens.
	 */
	public String[] split(String splittee, String splitChar, String def) {
		if (splittee == null || splitChar == null)
			return new String[0];
		StringTokenizer tokens;
		String temp;
		int spot;
		while ((spot = splittee.indexOf(splitChar + splitChar)) != -1)
			splittee = splittee.substring(0, spot + splitChar.length()) + def
					+ splittee.substring(spot + 1 * splitChar.length(), splittee.length());
		Vector returns = new Vector();
		tokens = new StringTokenizer(splittee, splitChar);
		while (tokens.hasMoreTokens()) {
			temp = tokens.nextToken();
			returns.addElement(temp);
		}
		String[] values = new String[returns.size()];
		returns.copyInto(values);
		return values;
=======
	public Cookie get(int i) {// Only used by GUI
		return (Cookie) getCookies().get(i).getObjectValue();
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}

    /*
Solution content
	/**
	 * Return the cookie at index i.
	 */
	public Cookie get(int i) {// Only used by GUI
		return (Cookie) getCookies().get(i).getObjectValue();
	}

    /*
File
CookieManager.java
Developer's decision
Version 2
Kind of conflict
Cast expression
Comment
If statement
Method declaration
Method invocation
Method signature
Return statement
Variable
While statement
Chunk
Conflicting content
    // Documentation is shared with our parent
    public String getDocAnchor() {
	}

	public String getStaticLabel() {
<<<<<<< HEAD
		return super.getStaticLabel() + " HTTPClient";
	}

    public String getDocAnchor() {
        return super.getStaticLabel().replace(' ', '_');
=======
		return JMeterUtils.getResString("web_testing2_title"); //$NON-NLS-1$
	}
        return super.getStaticLabel().replace(' ', '_'); // $NON-NLS-1$  // $NON-NLS-2$
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
    }

}
Solution content
	}

	public String getStaticLabel() {
		return JMeterUtils.getResString("web_testing2_title"); //$NON-NLS-1$
	}

    // Documentation is shared with our parent
    public String getDocAnchor() {
        return super.getStaticLabel().replace(' ', '_'); // $NON-NLS-1$  // $NON-NLS-2$
    }

}
File
HttpTestSampleGui2.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Method signature
Return statement
Chunk
Conflicting content
		WebServiceSampler sampler = (WebServiceSampler) s;
		this.configureTestElement(sampler);
		sampler.setDomain(domain.getText());
<<<<<<< HEAD
		sampler.setProperty(HTTPSamplerBase.PORT,port.getText());
=======
        sampler.setProperty(HTTPSamplerBase.PORT,port.getText());
        sampler.setProtocol(protocol.getText());
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		sampler.setPath(path.getText());
		sampler.setWsdlURL(wsdlField.getText());
		sampler.setMethod(HTTPSamplerBase.POST);
Solution content
		WebServiceSampler sampler = (WebServiceSampler) s;
		this.configureTestElement(sampler);
		sampler.setDomain(domain.getText());
        sampler.setProperty(HTTPSamplerBase.PORT,port.getText());
        sampler.setProtocol(protocol.getText());
		sampler.setPath(path.getText());
		sampler.setWsdlURL(wsdlField.getText());
		sampler.setMethod(HTTPSamplerBase.POST);
File
WebServiceSamplerGui.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
<<<<<<< HEAD
// $Header$
/*
 * Copyright 2003-2004 The Apache Software Foundation.
 *
 * Licensed 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 org.apache.jmeter.protocol.http.parser;

import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;

import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;

import org.htmlparser.Node;
import org.htmlparser.NodeReader;
import org.htmlparser.Parser;
import org.htmlparser.scanners.AppletScanner;
import org.htmlparser.scanners.BaseHrefScanner;
import org.htmlparser.scanners.BgSoundScanner;
import org.htmlparser.scanners.BodyScanner;
import org.htmlparser.scanners.FrameScanner;
import org.htmlparser.scanners.InputTagScanner;
import org.htmlparser.scanners.LinkScanner;
import org.htmlparser.scanners.LinkTagScanner;
import org.htmlparser.scanners.ScriptScanner;
import org.htmlparser.tags.AppletTag;
import org.htmlparser.tags.BaseHrefTag;
import org.htmlparser.tags.BgSoundTag;
import org.htmlparser.tags.BodyTag;
import org.htmlparser.tags.FrameTag;
import org.htmlparser.tags.ImageTag;
import org.htmlparser.tags.InputTag;
import org.htmlparser.tags.LinkTag;
import org.htmlparser.tags.LinkTagTag;
import org.htmlparser.tags.ScriptTag;
import org.htmlparser.tags.Tag;
import org.htmlparser.util.DefaultParserFeedback;
import org.htmlparser.util.NodeIterator;
import org.htmlparser.util.ParserException;

/**
 * HtmlParser implementation using SourceForge's HtmlParser.
 * 
 * @version $Revision$ updated on $Date$
 */
class HtmlParserHTMLParser extends HTMLParser {
	/** Used to store the Logger (used for debug and error messages). */
	transient private static Logger log = LoggingManager.getLoggerForClass();

	protected HtmlParserHTMLParser() {
		super();
	}

	protected boolean isReusable() {
		return true;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.jmeter.protocol.http.parser.HtmlParser#getEmbeddedResourceURLs(byte[],
	 *      java.net.URL)
	 */
	public Iterator getEmbeddedResourceURLs(byte[] html, URL baseUrl, URLCollection urls) throws HTMLParseException {
		Parser htmlParser = null;
		try {
			String contents = new String(html);
			StringReader reader = new StringReader(contents);

			NodeReader nreader = new NodeReader(reader, contents.length());
			htmlParser = new Parser(nreader, new DefaultParserFeedback());
			addTagListeners(htmlParser);
		} catch (Exception e) {
			throw new HTMLParseException(e);
		}

		// Now parse the DOM tree

		// look for applets

		// This will only work with an Applet .class file.
		// Ideally, this should be upgraded to work with Objects (IE)
		// and archives (.jar and .zip) files as well.

		try {
			// we start to iterate through the elements
			for (NodeIterator e = htmlParser.elements(); e.hasMoreNodes();) {
				Node node = e.nextNode();
				String binUrlStr = null;

				// first we check to see if body tag has a
				// background set and we set the NodeIterator
				// to the child elements inside the body
				if (node instanceof BodyTag) {
					BodyTag body = (BodyTag) node;
					binUrlStr = body.getAttribute("background");
					// if the body tag exists, we get the elements
					// within the body tag. if we don't we won't
					// see the body of the page. The only catch
					// with this is if there are images after the
					// closing body tag, it won't get parsed. If
					// someone puts it outside the body tag, it
					// is probably a mistake. Plus it's bad to
					// have important content after the closing
					// body tag. Peter Lin 10-9-03
					e = body.elements();
				} else if (node instanceof BaseHrefTag) {
					BaseHrefTag baseHref = (BaseHrefTag) node;
					String baseref = baseHref.getBaseUrl().toString();
					try {
						if (!baseref.equals(""))// Bugzilla 30713
						{
							baseUrl = new URL(baseUrl, baseHref.getBaseUrl() + "/");
						}
					} catch (MalformedURLException e1) {
						throw new HTMLParseException(e1);
					}
				} else if (node instanceof ImageTag) {
					ImageTag image = (ImageTag) node;
					binUrlStr = image.getImageURL();
				} else if (node instanceof AppletTag) {
					AppletTag applet = (AppletTag) node;
					binUrlStr = applet.getAppletClass();
				} else if (node instanceof InputTag) {
					InputTag input = (InputTag) node;
					// we check the input tag type for image
					String strType = input.getAttribute("type");
					if (strType != null && strType.equalsIgnoreCase("image")) {
						// then we need to download the binary
						binUrlStr = input.getAttribute("src");
					}
				} else if (node instanceof LinkTag) {
					LinkTag link = (LinkTag) node;
					if (link.getChild(0) instanceof ImageTag) {
						ImageTag img = (ImageTag) link.getChild(0);
						binUrlStr = img.getImageURL();
					}
				} else if (node instanceof ScriptTag) {
					ScriptTag script = (ScriptTag) node;
					binUrlStr = script.getAttribute("src");
				} else if (node instanceof FrameTag) {
					FrameTag tag = (FrameTag) node;
					binUrlStr = tag.getAttribute("src");
				} else if (node instanceof LinkTagTag) {
					LinkTagTag script = (LinkTagTag) node;
					if (script.getAttribute("rel").equalsIgnoreCase("stylesheet")) {
						binUrlStr = script.getAttribute("href");
					}
				} else if (node instanceof FrameTag) {
					FrameTag script = (FrameTag) node;
					binUrlStr = script.getAttribute("src");
				} else if (node instanceof BgSoundTag) {
					BgSoundTag script = (BgSoundTag) node;
					binUrlStr = script.getAttribute("src");
                } else if (node instanceof Tag) {
                    Tag tag = (Tag) node;
                    String tagname=tag.getTagName();
                    if (tagname.equalsIgnoreCase("EMBED")){
                        binUrlStr = tag.getAttribute("src");  
                    }
                }

				if (binUrlStr == null) {
					continue;
		}
				}

				urls.addURL(binUrlStr, baseUrl);
			}
			log.debug("End   : parseNodes");
		} catch (ParserException e) {
			throw new HTMLParseException(e);

		return urls.iterator();
	}

	/**
	 * Returns a node representing a whole xml given an xml document.
	 * 
	 * @param text
	 *            an xml document
	 * @return a node representing a whole xml
	 * 
	 * @throws SAXException
	 *             indicates an error parsing the xml document
	 */
	private static void addTagListeners(Parser parser) {
		log.debug("Start : addTagListeners");
		// add body tag scanner
		parser.addScanner(new BodyScanner());
		// add BaseHRefTag scanner
		parser.addScanner(new BaseHrefScanner());
		// add ImageTag and BaseHrefTag scanners
		LinkScanner linkScanner = new LinkScanner(LinkTag.LINK_TAG_FILTER);
		// parser.addScanner(linkScanner);
		parser.addScanner(linkScanner.createImageScanner(ImageTag.IMAGE_TAG_FILTER));
		parser.addScanner(linkScanner.createBaseHREFScanner("-b"));
		// Taken from org.htmlparser.Parser
		// add input tag scanner
		parser.addScanner(new InputTagScanner());
		// add applet tag scanner
		parser.addScanner(new AppletScanner());
		parser.addScanner(new ScriptScanner());
		parser.addScanner(new LinkTagScanner());
		parser.addScanner(new FrameScanner());
		parser.addScanner(new BgSoundScanner());
	}
}
=======
/*
 * 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 org.apache.jmeter.protocol.http.parser;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;

import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;
import org.htmlparser.Node;
import org.htmlparser.Parser;
import org.htmlparser.Tag;
import org.htmlparser.tags.AppletTag;
import org.htmlparser.tags.BaseHrefTag;
import org.htmlparser.tags.BodyTag;
import org.htmlparser.tags.CompositeTag;
import org.htmlparser.tags.FrameTag;
import org.htmlparser.tags.ImageTag;
import org.htmlparser.tags.InputTag;
import org.htmlparser.tags.LinkTag;
import org.htmlparser.tags.ScriptTag;
import org.htmlparser.util.NodeIterator;
import org.htmlparser.util.ParserException;

/**
 * HtmlParser implementation using SourceForge's HtmlParser.
 * 
 */
class HtmlParserHTMLParser extends HTMLParser {
    private static final Logger log = LoggingManager.getLoggerForClass();

    static{
    	org.htmlparser.scanners.ScriptScanner.STRICT = false; // Try to ensure that more javascript code is processed OK ...
    }
	
    protected HtmlParserHTMLParser() {
		super();
        log.info("Using htmlparser version: "+Parser.getVersion());
	}
	 * 
	 * @see org.apache.jmeter.protocol.http.parser.HtmlParser#getEmbeddedResourceURLs(byte[],
	protected boolean isReusable() {
		return true;
	}

	/*
	 * (non-Javadoc)
	 *      java.net.URL)
	 */
	public Iterator getEmbeddedResourceURLs(byte[] html, URL baseUrl, URLCollection urls) throws HTMLParseException {
        
        if (log.isDebugEnabled()) log.debug("Parsing html of: " + baseUrl);
        
        Parser htmlParser = null;
		try {
			String contents = new String(html);
			htmlParser = new Parser();
            htmlParser.setInputHTML(contents);
		} catch (Exception e) {
			throw new HTMLParseException(e);
		}

		// Now parse the DOM tree
		try {
			// we start to iterate through the elements
			parseNodes(htmlParser.elements(), new URLPointer(baseUrl), urls);
			log.debug("End   : parseNodes");
		} catch (ParserException e) {
			throw new HTMLParseException(e);
		}

		return urls.iterator();
	}
	
    /*
	 * A dummy class to pass the pointer of URL.
	 */
    private static class URLPointer {
    	private URLPointer(URL newUrl) {
    		url = newUrl;
    	}
    	private URL url;
    }
    
    /**
     * Recursively parse all nodes to pick up all URL s.
     * @see e the nodes to be parsed
     * @see baseUrl Base URL from which the HTML code was obtained
     * @see urls URLCollection
     */
    private void parseNodes(final NodeIterator e,
    		final URLPointer baseUrl, final URLCollection urls) 
        throws HTMLParseException, ParserException {
        while(e.hasMoreNodes()) {
            Node node = e.nextNode();
            // a url is always in a Tag.
            if (!(node instanceof Tag)) {
                continue;
            }
            Tag tag = (Tag) node;
            String tagname=tag.getTagName();
            String binUrlStr = null;

            // first we check to see if body tag has a
            // background set
            if (tag instanceof BodyTag) {
                binUrlStr = tag.getAttribute(ATT_BACKGROUND);
            } else if (tag instanceof BaseHrefTag) {
                BaseHrefTag baseHref = (BaseHrefTag) tag;
                String baseref = baseHref.getBaseUrl().toString();
                try {
                    if (!baseref.equals(""))// Bugzilla 30713
                    {
                        baseUrl.url = new URL(baseUrl.url, baseHref.getBaseUrl());
                    }
                } catch (MalformedURLException e1) {
                    throw new HTMLParseException(e1);
                }
            } else if (tag instanceof ImageTag) {
                ImageTag image = (ImageTag) tag;
                binUrlStr = image.getImageURL();
            } else if (tag instanceof AppletTag) {
        		// look for applets

        		// This will only work with an Applet .class file.
        		// Ideally, this should be upgraded to work with Objects (IE)
        		// and archives (.jar and .zip) files as well.
                AppletTag applet = (AppletTag) tag;
                binUrlStr = applet.getAppletClass();
            } else if (tag instanceof InputTag) {
                // we check the input tag type for image
                if (ATT_IS_IMAGE.equalsIgnoreCase(tag.getAttribute(ATT_TYPE))) {
                    // then we need to download the binary
                    binUrlStr = tag.getAttribute(ATT_SRC);
                }
            } else if (tag instanceof LinkTag) {
                LinkTag link = (LinkTag) tag;
                if (link.getChild(0) instanceof ImageTag) {
                    ImageTag img = (ImageTag) link.getChild(0);
                    binUrlStr = img.getImageURL();
                }
            } else if (tag instanceof ScriptTag) {
                binUrlStr = tag.getAttribute(ATT_SRC);
            } else if (tag instanceof FrameTag) {
                binUrlStr = tag.getAttribute(ATT_SRC);
            } else if (tagname.equalsIgnoreCase(TAG_EMBED)
                || tagname.equalsIgnoreCase(TAG_BGSOUND)){
                binUrlStr = tag.getAttribute(ATT_SRC);  
            } else if (tagname.equalsIgnoreCase(TAG_LINK)) {
                // Putting the string first means it works even if the attribute is null
                if (STYLESHEET.equalsIgnoreCase(tag.getAttribute(ATT_REL))) {
                    binUrlStr = tag.getAttribute(ATT_HREF);
                }
            } else {
                binUrlStr = tag.getAttribute(ATT_BACKGROUND);
            }

            if (binUrlStr != null) {
                urls.addURL(binUrlStr, baseUrl.url);
            }

            // Now look for URLs in the STYLE attribute
            String styleTagStr = tag.getAttribute(ATT_STYLE);
            if(styleTagStr != null) {
            	HtmlParsingUtils.extractStyleURLs(baseUrl.url, urls, styleTagStr);
            }

            // second, if the tag was a composite tag,
            // recursively parse its children.
            if (tag instanceof CompositeTag) {
                CompositeTag composite = (CompositeTag) tag;
                parseNodes(composite.elements(), baseUrl, urls);
            }
        }
    }

}
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
Solution content
/*
 * 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 org.apache.jmeter.protocol.http.parser;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;

import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;
import org.htmlparser.Node;
import org.htmlparser.Parser;
import org.htmlparser.Tag;
import org.htmlparser.tags.AppletTag;
import org.htmlparser.tags.BaseHrefTag;
import org.htmlparser.tags.BodyTag;
import org.htmlparser.tags.CompositeTag;
import org.htmlparser.tags.FrameTag;
import org.htmlparser.tags.ImageTag;
import org.htmlparser.tags.InputTag;
import org.htmlparser.tags.LinkTag;
import org.htmlparser.tags.ScriptTag;
import org.htmlparser.util.NodeIterator;
import org.htmlparser.util.ParserException;

/**
 * HtmlParser implementation using SourceForge's HtmlParser.
 * 
 */
class HtmlParserHTMLParser extends HTMLParser {
    private static final Logger log = LoggingManager.getLoggerForClass();

    static{
    	org.htmlparser.scanners.ScriptScanner.STRICT = false; // Try to ensure that more javascript code is processed OK ...
    }
	
    protected HtmlParserHTMLParser() {
		super();
        log.info("Using htmlparser version: "+Parser.getVersion());
	}

	protected boolean isReusable() {
		return true;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.jmeter.protocol.http.parser.HtmlParser#getEmbeddedResourceURLs(byte[],
	 *      java.net.URL)
	 */
	public Iterator getEmbeddedResourceURLs(byte[] html, URL baseUrl, URLCollection urls) throws HTMLParseException {
        
        if (log.isDebugEnabled()) log.debug("Parsing html of: " + baseUrl);
        
        Parser htmlParser = null;
		try {
			String contents = new String(html);
			htmlParser = new Parser();
            htmlParser.setInputHTML(contents);
		} catch (Exception e) {
			throw new HTMLParseException(e);
		}

		// Now parse the DOM tree
		try {
			// we start to iterate through the elements
			parseNodes(htmlParser.elements(), new URLPointer(baseUrl), urls);
			log.debug("End   : parseNodes");
		} catch (ParserException e) {
			throw new HTMLParseException(e);
		}

		return urls.iterator();
	}
	
    /*
	 * A dummy class to pass the pointer of URL.
	 */
    private static class URLPointer {
    	private URLPointer(URL newUrl) {
    		url = newUrl;
    	}
    	private URL url;
    }
    
    /**
     * Recursively parse all nodes to pick up all URL s.
     * @see e the nodes to be parsed
     * @see baseUrl Base URL from which the HTML code was obtained
     * @see urls URLCollection
     */
    private void parseNodes(final NodeIterator e,
    		final URLPointer baseUrl, final URLCollection urls) 
        throws HTMLParseException, ParserException {
        while(e.hasMoreNodes()) {
            Node node = e.nextNode();
            // a url is always in a Tag.
            if (!(node instanceof Tag)) {
                continue;
            }
            Tag tag = (Tag) node;
            String tagname=tag.getTagName();
            String binUrlStr = null;

            // first we check to see if body tag has a
            // background set
            if (tag instanceof BodyTag) {
                binUrlStr = tag.getAttribute(ATT_BACKGROUND);
            } else if (tag instanceof BaseHrefTag) {
                BaseHrefTag baseHref = (BaseHrefTag) tag;
                String baseref = baseHref.getBaseUrl().toString();
                try {
                    if (!baseref.equals(""))// Bugzilla 30713
                    {
                        baseUrl.url = new URL(baseUrl.url, baseHref.getBaseUrl());
                    }
                } catch (MalformedURLException e1) {
                    throw new HTMLParseException(e1);
                }
            } else if (tag instanceof ImageTag) {
                ImageTag image = (ImageTag) tag;
                binUrlStr = image.getImageURL();
            } else if (tag instanceof AppletTag) {
        		// look for applets

        		// This will only work with an Applet .class file.
        		// Ideally, this should be upgraded to work with Objects (IE)
        		// and archives (.jar and .zip) files as well.
                AppletTag applet = (AppletTag) tag;
                binUrlStr = applet.getAppletClass();
            } else if (tag instanceof InputTag) {
                // we check the input tag type for image
                if (ATT_IS_IMAGE.equalsIgnoreCase(tag.getAttribute(ATT_TYPE))) {
                    // then we need to download the binary
                    binUrlStr = tag.getAttribute(ATT_SRC);
                }
            } else if (tag instanceof LinkTag) {
                LinkTag link = (LinkTag) tag;
                if (link.getChild(0) instanceof ImageTag) {
                    ImageTag img = (ImageTag) link.getChild(0);
                    binUrlStr = img.getImageURL();
                }
            } else if (tag instanceof ScriptTag) {
                binUrlStr = tag.getAttribute(ATT_SRC);
            } else if (tag instanceof FrameTag) {
                binUrlStr = tag.getAttribute(ATT_SRC);
            } else if (tagname.equalsIgnoreCase(TAG_EMBED)
                || tagname.equalsIgnoreCase(TAG_BGSOUND)){
                binUrlStr = tag.getAttribute(ATT_SRC);  
            } else if (tagname.equalsIgnoreCase(TAG_LINK)) {
                // Putting the string first means it works even if the attribute is null
                if (STYLESHEET.equalsIgnoreCase(tag.getAttribute(ATT_REL))) {
                    binUrlStr = tag.getAttribute(ATT_HREF);
                }
            } else {
                binUrlStr = tag.getAttribute(ATT_BACKGROUND);
            }

            if (binUrlStr != null) {
                urls.addURL(binUrlStr, baseUrl.url);
            }

            // Now look for URLs in the STYLE attribute
            String styleTagStr = tag.getAttribute(ATT_STYLE);
            if(styleTagStr != null) {
            	HtmlParsingUtils.extractStyleURLs(baseUrl.url, urls, styleTagStr);
            }

            // second, if the tag was a composite tag,
            // recursively parse its children.
            if (tag instanceof CompositeTag) {
                CompositeTag composite = (CompositeTag) tag;
                parseNodes(composite.elements(), baseUrl, urls);
            }
        }
    }

}
File
HtmlParserHTMLParser.java
Developer's decision
Version 2
Kind of conflict
Class declaration
Comment
Import
Package declaration
Chunk
Conflicting content
				break;
			}

<<<<<<< HEAD
			if (name.equalsIgnoreCase("img") || name.equalsIgnoreCase("embed")) {
				urls.addURL(getValue(attrs, "src"), baseUrl);
=======
			if (name.equalsIgnoreCase(TAG_IMAGE) || name.equalsIgnoreCase(TAG_EMBED)) {
				urls.addURL(getValue(attrs, ATT_SRC), baseUrl);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
				break;
			}
Solution content
				break;
			}

			if (name.equalsIgnoreCase(TAG_IMAGE) || name.equalsIgnoreCase(TAG_EMBED)) {
				urls.addURL(getValue(attrs, ATT_SRC), baseUrl);
				break;
			}
File
JTidyHTMLParser.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
        if(filter instanceof ThreadListener)
            ((ThreadListener)filter).threadFinished();
    }
<<<<<<< HEAD

	/* (non-Javadoc)
	 * @see org.apache.jmeter.testelement.ThreadListener#threadStarted()
	 */
	public void threadStarted() {
		// TODO Auto-generated method stub
		
	}
=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
}
Solution content
        if(filter instanceof ThreadListener)
            ((ThreadListener)filter).threadFinished();
    }
}
File
AccessLogSampler.java
Developer's decision
Version 2
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
import org.apache.jmeter.protocol.http.control.Authorization;
import org.apache.jmeter.protocol.http.control.CookieManager;
import org.apache.jmeter.protocol.http.control.HeaderManager;
<<<<<<< HEAD

import org.apache.jmeter.testelement.ThreadListener;
=======
import org.apache.jmeter.protocol.http.util.EncoderCache;
import org.apache.jmeter.protocol.http.util.SlowHttpClientSocketFactory;
import org.apache.jmeter.protocol.http.util.HTTPArgument;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
import org.apache.jmeter.testelement.property.CollectionProperty;
import org.apache.jmeter.testelement.property.PropertyIterator;
import org.apache.jmeter.util.JMeterUtils;
Solution content
import org.apache.jmeter.protocol.http.control.Authorization;
import org.apache.jmeter.protocol.http.control.CookieManager;
import org.apache.jmeter.protocol.http.control.HeaderManager;
import org.apache.jmeter.protocol.http.util.EncoderCache;
import org.apache.jmeter.protocol.http.util.SlowHttpClientSocketFactory;
import org.apache.jmeter.protocol.http.util.HTTPArgument;
import org.apache.jmeter.testelement.property.CollectionProperty;
import org.apache.jmeter.testelement.property.PropertyIterator;
import org.apache.jmeter.util.JMeterUtils;
File
HTTPSampler2.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
 * HTTP requests, including cookies and authentication.
 * 
 */
<<<<<<< HEAD
public class HTTPSampler2 extends HTTPSamplerBase implements ThreadListener {
	transient private static Logger log = LoggingManager.getLoggerForClass();

	static {
		// Set the default to Avalon Logkit, if not already defined:
		if (System.getProperty("org.apache.commons.logging.Log") == null) {
			System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.LogKitLogger");
		}
	}

	/*
	 * Connection is re-used if possible
	 */
	private transient HttpConnection httpConn = null;
=======
public class HTTPSampler2 extends HTTPSamplerBase {
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

    private static final Logger log = LoggingManager.getLoggerForClass();
Solution content
 * HTTP requests, including cookies and authentication.
 * 
 */
public class HTTPSampler2 extends HTTPSamplerBase {

    private static final Logger log = LoggingManager.getLoggerForClass();
File
HTTPSampler2.java
Developer's decision
Version 2
Kind of conflict
Attribute
Class signature
Comment
Method invocation
Static initializer
Chunk
Conflicting content
	public void threadStarted() {
		log.debug("Thread Started");
<<<<<<< HEAD
	}

	public void threadFinished() {
		log.debug("Thread Finished");
		if (httpConn != null)
			httpConn.close();
=======
        
		// Does not need to be synchronised, as all access is from same thread
        httpClients.set ( new HashMap() );	
    }

	public void threadFinished() {
		log.debug("Thread Finished");

        // Does not need to be synchronised, as all access is from same thread
		Map map = (Map)httpClients.get();

		if ( map != null ) {
			for ( Iterator it = map.entrySet().iterator(); it.hasNext(); )
			{
				Map.Entry entry = (Map.Entry) it.next();
				HttpClient cl = (HttpClient) entry.getValue();
                cl.getHttpConnectionManager().closeIdleConnections(-1000);// Closes the connection
			}
			map.clear();
		}
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}
}
Solution content
	public void threadStarted() {
		log.debug("Thread Started");
        
		// Does not need to be synchronised, as all access is from same thread
        httpClients.set ( new HashMap() );	
    }

	public void threadFinished() {
		log.debug("Thread Finished");

        // Does not need to be synchronised, as all access is from same thread
		Map map = (Map)httpClients.get();

		if ( map != null ) {
			for ( Iterator it = map.entrySet().iterator(); it.hasNext(); )
			{
				Map.Entry entry = (Map.Entry) it.next();
				HttpClient cl = (HttpClient) entry.getValue();
                cl.getHttpConnectionManager().closeIdleConnections(-1000);// Closes the connection
			}
			map.clear();
		}
	}
}
File
HTTPSampler2.java
Developer's decision
Version 2
Kind of conflict
Cast expression
Comment
If statement
Method invocation
Method signature
Variable
Chunk
Conflicting content
import java.io.Serializable;
import java.util.ArrayList;

<<<<<<< HEAD
import org.apache.jmeter.junit.JMeterTestCase;
=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.oro.text.MalformedCachePatternException;
Solution content
import java.io.Serializable;
import java.util.ArrayList;

import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.oro.text.MalformedCachePatternException;
File
LogFilter.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
		}
	}

<<<<<<< HEAD
	// ///////////////////// Start of Test Code //////////////////////

	public static class Test extends JMeterTestCase {

		private static final String TESTSTR = "/test/helloworld.html";

		private static final String TESTSTROUT = "/test/helloworld.jsp";

		private static class TestData {
			private final String file;

			private final boolean exclfile;

			private final boolean inclfile;

			private final boolean exclpatt;

			private final boolean inclpatt;

			TestData(String f, boolean exf, boolean inf, boolean exp, boolean inp) {
				file = f;
				exclfile = exf;
				inclfile = inf;
				exclpatt = exp;
				inclpatt = inp;
			}
		}

		private static final String[] INCL = { "hello.html", "index.html", "/index.jsp" };

		private static final String[] PATTERNS = { "index", ".jtml" };

		private static final TestData[] TESTDATA = {
		// file exclf inclf exclp inclp
				new TestData("/test/hello.jsp", true, false, true, false),
				new TestData("/test/one/hello.html", false, true, true, false),
				new TestData("hello.jsp", true, false, true, false),
				new TestData("hello.htm", true, false, true, false),
				new TestData("/test/open.jsp", true, false, true, false),
				new TestData("/test/open.html", true, false, true, false),
				new TestData("/index.jsp", false, true, false, true),
				new TestData("/index.jhtml", true, false, false, true),
				new TestData("newindex.jsp", true, false, false, true),
				new TestData("oldindex.jsp", true, false, false, true),
				new TestData("oldindex1.jsp", true, false, false, true),
				new TestData("oldindex2.jsp", true, false, false, true),
				new TestData("oldindex3.jsp", true, false, false, true),
				new TestData("oldindex4.jsp", true, false, false, true),
				new TestData("oldindex5.jsp", true, false, false, true),
				new TestData("oldindex6.jsp", true, false, false, true),
				new TestData("/test/index.htm", true, false, false, true) };

		public void testConstruct() {
			new LogFilter();
		}

		private LogFilter testf;

		public void setUp() {
			testf = new LogFilter();
		}

		public void testReplaceExtension() {
			testf.setReplaceExtension("html", "jsp");
			testf.isFiltered(TESTSTR,null);// set the required variables
			assertEquals(TESTSTROUT, testf.filter(TESTSTR));
		}

		public void testExcludeFiles() {
			testf.excludeFiles(INCL);
			for (int idx = 0; idx < TESTDATA.length; idx++) {
				TestData td = TESTDATA[idx];
				String theFile = td.file;
				boolean expect = td.exclfile;

				testf.isFiltered(theFile,null);
				String line = testf.filter(theFile);
				if (line != null) {
					assertTrue("Expect to accept " + theFile, expect);
				} else {
					assertFalse("Expect to reject " + theFile, expect);
				}
			}
		}

		public void testIncludeFiles() {
			testf.includeFiles(INCL);
			for (int idx = 0; idx < TESTDATA.length; idx++) {
				TestData td = TESTDATA[idx];
				String theFile = td.file;
				boolean expect = td.inclfile;

				testf.isFiltered(theFile,null);
				String line = testf.filter(theFile);
				if (line != null) {
					assertTrue("Expect to accept " + theFile, expect);
				} else {
					assertFalse("Expect to reject " + theFile, expect);
				}
			}

		}

		public void testExcludePattern() {
			testf.excludePattern(PATTERNS);
			for (int idx = 0; idx < TESTDATA.length; idx++) {
				TestData td = TESTDATA[idx];
				String theFile = td.file;
				boolean expect = td.exclpatt;

				assertEquals(!expect, testf.isFiltered(theFile,null));
				String line = testf.filter(theFile);
				if (line != null) {
					assertTrue("Expect to accept " + theFile, expect);
				} else {
					assertFalse("Expect to reject " + theFile, expect);
				}
			}
		}

		public void testIncludePattern() {
			testf.includePattern(PATTERNS);
			for (int idx = 0; idx < TESTDATA.length; idx++) {
				TestData td = TESTDATA[idx];
				String theFile = td.file;
				boolean expect = td.inclpatt;

				assertEquals(!expect, testf.isFiltered(theFile,null));
				String line = testf.filter(theFile);
				if (line != null) {
					assertTrue("Expect to accept " + theFile, expect);
				} else {
					assertFalse("Expect to reject " + theFile, expect);
				}
			}
		}
	}

=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	/*
	 * (non-Javadoc)
	 * 
Solution content
		}
	}

	/*
	 * (non-Javadoc)
	 * 
File
LogFilter.java
Developer's decision
Version 2
Kind of conflict
Class declaration
Comment
Chunk
Conflicting content
	private static final String NULL_MARKER = 
		JMeterUtils.getPropDefault("jdbcsampler.nullmarker","]NULL["); // $NON-NLS-1$

<<<<<<< HEAD
	public static final String QUERY = "query";
	public static final String SELECT = "Select Statement";
=======
	private static final Map mapJdbcNameToInt;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

    static {
        // based on e291. Getting the Name of a JDBC Type from javaalmanac.com
Solution content
    static {
	private static final String NULL_MARKER = 
		JMeterUtils.getPropDefault("jdbcsampler.nullmarker","]NULL["); // $NON-NLS-1$

	private static final Map mapJdbcNameToInt;

        // based on e291. Getting the Name of a JDBC Type from javaalmanac.com
File
JDBCSampler.java
Developer's decision
Version 2
Kind of conflict
Attribute
Chunk
Conflicting content
	static final String AUTOCOMMIT_FALSE = "AutoCommit(false)"; // $NON-NLS-1$
	static final String AUTOCOMMIT_TRUE  = "AutoCommit(true)"; // $NON-NLS-1$

<<<<<<< HEAD
	public String queryType = SELECT;
=======
	private String query = ""; // $NON-NLS-1$

	private String dataSource = ""; // $NON-NLS-1$

	private String queryType = SELECT;
	private String queryArguments = ""; // $NON-NLS-1$
	private String queryArgumentsTypes = ""; // $NON-NLS-1$
	
	/**
	 *  Cache of PreparedStatements stored in a per-connection basis. Each entry of this 
	 *  cache is another Map mapping the statement string to the actual PreparedStatement.
	 *  The cache has a fixed size of MAX_ENTRIES and it will throw aways all PreparedStatements 
	 *  from the least recently used connections.  
	 */
	private static Map perConnCache = new LinkedHashMap(MAX_ENTRIES){
		protected boolean removeEldestEntry(java.util.Map.Entry arg0) {
			if (size() > MAX_ENTRIES) {
				final Object value = arg0.getValue();
				if (value instanceof Map) {
					closeAllStatements(((Map)value).values());
				}
				return true;
			}
			return false;
		}
	};
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

	/**
	 * Creates a JDBCSampler.
Solution content
	static final String AUTOCOMMIT_FALSE = "AutoCommit(false)"; // $NON-NLS-1$
	static final String AUTOCOMMIT_TRUE  = "AutoCommit(true)"; // $NON-NLS-1$

	private String query = ""; // $NON-NLS-1$

	private String dataSource = ""; // $NON-NLS-1$

	private String queryType = SELECT;
	private String queryArguments = ""; // $NON-NLS-1$
	private String queryArgumentsTypes = ""; // $NON-NLS-1$
	
	/**
	 *  Cache of PreparedStatements stored in a per-connection basis. Each entry of this 
	 *  cache is another Map mapping the statement string to the actual PreparedStatement.
	 *  The cache has a fixed size of MAX_ENTRIES and it will throw aways all PreparedStatements 
	 *  from the least recently used connections.  
	 */
	private static Map perConnCache = new LinkedHashMap(MAX_ENTRIES){
		protected boolean removeEldestEntry(java.util.Map.Entry arg0) {
			if (size() > MAX_ENTRIES) {
				final Object value = arg0.getValue();
				if (value instanceof Map) {
					closeAllStatements(((Map)value).values());
				}
				return true;
			}
			return false;
		}
	};

	/**
	 * Creates a JDBCSampler.
File
JDBCSampler.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method invocation
Chunk
Conflicting content
			// connection.
			conn = pool.getConnection();

<<<<<<< HEAD
			// Based on query return value, get results
			if (SELECT.equals(getQueryType())) {
=======
            // Based on query return value, get results
            String _queryType = getQueryType();
            if (SELECT.equals(_queryType)) {
            	stmt = conn.createStatement();
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
				ResultSet rs = null;
				try {
					rs = stmt.executeQuery(getQuery());
Solution content
			// connection.
			conn = pool.getConnection();

            // Based on query return value, get results
            String _queryType = getQueryType();
            if (SELECT.equals(_queryType)) {
            	stmt = conn.createStatement();
				ResultSet rs = null;
				try {
					rs = stmt.executeQuery(getQuery());
File
JDBCSampler.java
Developer's decision
Version 2
Kind of conflict
Comment
If statement
Method invocation
Variable
Chunk
Conflicting content
	 */
	public void setQueryType(String queryType) {
		this.queryType = queryType;
<<<<<<< HEAD
=======
	}

	public String getQueryArguments() {
		return queryArguments;
	}

	public void setQueryArguments(String queryArguments) {
		this.queryArguments = queryArguments;
	}

	public String getQueryArgumentsTypes() {
		return queryArgumentsTypes;
	}

	public void setQueryArgumentsTypes(String queryArgumentsType) {
		this.queryArgumentsTypes = queryArgumentsType;
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	}
}
Solution content
	 */
	public void setQueryType(String queryType) {
		this.queryType = queryType;
	}

	public String getQueryArguments() {
		return queryArguments;
	}

	public void setQueryArguments(String queryArguments) {
		this.queryArguments = queryArguments;
	}

	public String getQueryArgumentsTypes() {
		return queryArgumentsTypes;
	}

	public void setQueryArgumentsTypes(String queryArgumentsType) {
		this.queryArgumentsTypes = queryArgumentsType;
	}
}
File
JDBCSampler.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method declaration
Method signature
Variable
Chunk
Conflicting content
				"queryArgumentsTypes" // $NON-NLS-1$
				});

<<<<<<< HEAD
		createPropertyGroup("sql", new String[] { "queryType", "query" });
=======
		PropertyDescriptor p = property("dataSource"); // $NON-NLS-1$
		p.setValue(NOT_UNDEFINED, Boolean.TRUE);
		p.setValue(DEFAULT, "");
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

		p = property("queryArguments"); // $NON-NLS-1$
		p.setValue(NOT_UNDEFINED, Boolean.TRUE);
Solution content
				"queryArgumentsTypes" // $NON-NLS-1$
				});

		PropertyDescriptor p = property("dataSource"); // $NON-NLS-1$
		p.setValue(NOT_UNDEFINED, Boolean.TRUE);
		p.setValue(DEFAULT, "");

		p = property("queryArguments"); // $NON-NLS-1$
		p.setValue(NOT_UNDEFINED, Boolean.TRUE);
File
JDBCSamplerBeanInfo.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Variable
Chunk
Conflicting content
		p.setValue(DEFAULT, "");
		

<<<<<<< HEAD
		p = property("queryType");
		p.setValue(NOT_UNDEFINED, Boolean.TRUE);
		p.setValue(DEFAULT, JDBCSampler.SELECT);
		p.setValue(NOT_OTHER,Boolean.TRUE);
		p.setValue(TAGS,new String[]{JDBCSampler.SELECT,"Update Statement"});
=======
		p = property("queryType"); // $NON-NLS-1$
		p.setValue(NOT_UNDEFINED, Boolean.TRUE);
		p.setValue(DEFAULT, JDBCSampler.SELECT);
		p.setValue(NOT_OTHER,Boolean.TRUE);
		p.setValue(TAGS,new String[]{
				JDBCSampler.SELECT,
				JDBCSampler.UPDATE,
				JDBCSampler.CALLABLE, 
				JDBCSampler.PREPARED_SELECT, 
				JDBCSampler.PREPARED_UPDATE,
				JDBCSampler.COMMIT,
				JDBCSampler.ROLLBACK,
				JDBCSampler.AUTOCOMMIT_FALSE,
				JDBCSampler.AUTOCOMMIT_TRUE,
				});
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9

		p = property("query"); // $NON-NLS-1$
		p.setValue(NOT_UNDEFINED, Boolean.TRUE);
Solution content
		p.setValue(DEFAULT, "");
		

		p = property("queryType"); // $NON-NLS-1$
		p.setValue(NOT_UNDEFINED, Boolean.TRUE);
		p.setValue(DEFAULT, JDBCSampler.SELECT);
		p.setValue(NOT_OTHER,Boolean.TRUE);
		p.setValue(TAGS,new String[]{
				JDBCSampler.SELECT,
				JDBCSampler.UPDATE,
				JDBCSampler.CALLABLE, 
				JDBCSampler.PREPARED_SELECT, 
				JDBCSampler.PREPARED_UPDATE,
				JDBCSampler.COMMIT,
				JDBCSampler.ROLLBACK,
				JDBCSampler.AUTOCOMMIT_FALSE,
				JDBCSampler.AUTOCOMMIT_TRUE,
				});

		p = property("query"); // $NON-NLS-1$
		p.setValue(NOT_UNDEFINED, Boolean.TRUE);
File
JDBCSamplerBeanInfo.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Variable
Chunk
Conflicting content
	private byte[] RESULT = null;

<<<<<<< HEAD
	private Object OBJ_RESULT = null;

	// private long time = System.currentTimeMillis();
=======
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	private int counter;

	private int loop = 1; // TODO never read
Solution content
	private byte[] RESULT = null;

	private int counter;

	private int loop = 1; // TODO never read
File
ReceiveSubscriber.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
 * Sampler for JMS Communication. 
* Created on: October 28, 2004 * <<<<<<< HEAD * author Martijn Blankestijn * @version $Id$ */ public class JMSSampler extends AbstractSampler implements ThreadListener { ======= */ public class JMSSampler extends AbstractSampler implements ThreadListener { private static final Logger LOGGER = LoggingManager.getLoggerForClass(); >>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9 private static final int DEFAULT_TIMEOUT = 2000;
Solution content
 * Sampler for JMS Communication. 
* Created on: October 28, 2004 * */ public class JMSSampler extends AbstractSampler implements ThreadListener { private static final Logger LOGGER = LoggingManager.getLoggerForClass(); private static final int DEFAULT_TIMEOUT = 2000;
File
JMSSampler.java
Developer's decision
Version 2
Kind of conflict
Attribute
Class signature
Comment
Method invocation
Chunk
Conflicting content
/*
<<<<<<< HEAD
 * Copyright 2003-2005 The Apache Software Foundation.
 *
 * Licensed 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
=======
 * 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
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
Solution content
/*
 * 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
 *
File
TCPSampler.java
Developer's decision
Version 2
Kind of conflict
Comment
Chunk
Conflicting content
	public final static String REQUEST = "TCPSampler.request"; //$NON-NLS-1$

<<<<<<< HEAD
=======
	public final static String RE_USE_CONNECTION = "TCPSampler.reUseConnection"; //$NON-NLS-1$

	private final static String TCPKEY = "TCP"; //$NON-NLS-1$ key for HashMap

	private final static String ERRKEY = "ERR"; //$NON-NLS-1$ key for HashMap

>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	// If set, this is the regex that is used to extract the status from the
	// response
	// NOT implemented yet private final static String STATUS_REGEX =
Solution content
	public final static String REQUEST = "TCPSampler.request"; //$NON-NLS-1$

	public final static String RE_USE_CONNECTION = "TCPSampler.reUseConnection"; //$NON-NLS-1$

	private final static String TCPKEY = "TCP"; //$NON-NLS-1$ key for HashMap

	private final static String ERRKEY = "ERR"; //$NON-NLS-1$ key for HashMap

	// If set, this is the regex that is used to extract the status from the
	// response
	// NOT implemented yet private final static String STATUS_REGEX =
File
TCPSampler.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
            log.debug("Initialising socket "+hashKey);
        }
		Map cp = (Map) tp.get();
<<<<<<< HEAD
		Socket con = (Socket) cp.get(hashKey);
		if (con != null) {
			log.debug(this + " Reusing connection " + con); //$NON-NLS-1$
			return con;
=======
		Socket con = null;
		if (isReUseConnection()) {
			con = (Socket) cp.get(TCPKEY);
			if (con != null) {
				log.debug(this + " Reusing connection " + con); //$NON-NLS-1$
				return con;
			}
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		}

		// Not in cache, so create new one and cache it
Solution content
		Map cp = (Map) tp.get();
		Socket con = null;
		if (isReUseConnection()) {
			con = (Socket) cp.get(TCPKEY);
			if (con != null) {
				log.debug(this + " Reusing connection " + con); //$NON-NLS-1$
				return con;
			}
		}

		// Not in cache, so create new one and cache it
File
TCPSampler.java
Developer's decision
Version 2
Kind of conflict
Cast expression
Comment
If statement
Method invocation
Return statement
Variable
Chunk
Conflicting content
			log.debug(this + "  Timeout " + getTimeout() + " NoDelay " + getNoDelay()); //$NON-NLS-1$
			log.debug("Created new connection " + con); //$NON-NLS-1$
<<<<<<< HEAD
			cp.put(hashKey, con);
=======
			cp.put(TCPKEY, con);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
		} catch (UnknownHostException e) {
			log.warn("Unknown host for " + getLabel(), e);//$NON-NLS-1$
            except=e;
Solution content
			log.debug(this + "  Timeout " + getTimeout() + " NoDelay " + getNoDelay()); //$NON-NLS-1$
			log.debug("Created new connection " + con); //$NON-NLS-1$
			cp.put(TCPKEY, con);
		} catch (UnknownHostException e) {
			log.warn("Unknown host for " + getLabel(), e);//$NON-NLS-1$
File
TCPSampler.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
				}
			}
		} catch (IOException ex) {
<<<<<<< HEAD
			log.debug(getName(), ex);
=======
			log.debug("", ex);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
			res.setResponseCode("500");
			res.setResponseMessage(ex.toString());
            closeSocket();
Solution content
				}
			}
		} catch (IOException ex) {
			log.debug("", ex);
			res.setResponseCode("500");
			res.setResponseMessage(ex.toString());
            closeSocket();
File
TCPSampler.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
    
    		// Set if we were successful or not
    		res.setSuccessful(isSuccessful);
<<<<<<< HEAD
=======

			if (!isReUseConnection()) {
				closeSocket();
			}
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
        }

		return res;
Solution content
    
    		// Set if we were successful or not
    		res.setSuccessful(isSuccessful);

			if (!isReUseConnection()) {
				closeSocket();
			}
        }

		return res;
File
TCPSampler.java
Developer's decision
Version 2
Kind of conflict
If statement
Chunk
Conflicting content
		return res;
	}

<<<<<<< HEAD
    /**
	 * @param rc
	 *            response code
=======
	/**
	 * @param rc response code
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
	 * @return whether this represents success or not
	 */
	private boolean checkResponseCode(String rc) {
Solution content
		return res;
	}

	/**
	 * @param rc response code
	 * @return whether this represents success or not
	 */
	private boolean checkResponseCode(String rc) {
File
TCPSampler.java
Developer's decision
Version 2
Kind of conflict
Comment
Chunk
Conflicting content
	}

    public void threadStarted() {
<<<<<<< HEAD
        log.debug(getName() + " Thread Started");
=======
        log.debug("Thread Started");
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
    }

    private void closeSocket() {
Solution content
	}

    public void threadStarted() {
        log.debug("Thread Started");
    }

    private void closeSocket() {
File
TCPSampler.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
    private void closeSocket() {
        Map cp = (Map) tp.get();
<<<<<<< HEAD
        if (hashKey==null) return;
        Socket con = (Socket) cp.remove(hashKey);
        if (con != null) {
            log.debug(getName()+" Closing socket for " + hashKey); //$NON-NLS-1$
            try {
                con.close();
            } catch (IOException e) {
                log.warn(getName()+" Error closing socket for "+hashKey+" "+e);  //$NON-NLS-1$
=======
        Socket con = (Socket) cp.remove(TCPKEY);
        if (con != null) {
            log.debug(this + " Closing connection " + con); //$NON-NLS-1$
            try {
                con.close();
            } catch (IOException e) {
                log.warn("Error closing socket "+e);
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
            }
        }
    }
Solution content
    private void closeSocket() {
        Map cp = (Map) tp.get();
        Socket con = (Socket) cp.remove(TCPKEY);
        if (con != null) {
            log.debug(this + " Closing connection " + con); //$NON-NLS-1$
            try {
                con.close();
            } catch (IOException e) {
                log.warn("Error closing socket "+e);
            }
        }
    }
File
TCPSampler.java
Developer's decision
Version 2
Kind of conflict
Cast expression
Catch clause
Comment
If statement
Method invocation
Try statement
Variable
Chunk
Conflicting content
    }

    public void threadFinished() {
<<<<<<< HEAD
        log.debug(getName()+" Thread Finished");
=======
        log.debug("Thread Finished");
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9
        closeSocket();
    }
}
Solution content
    }

    public void threadFinished() {
        log.debug("Thread Finished");
        closeSocket();
    }
}
File
TCPSampler.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
            }
            String name = guiItem.getClass().getName();
			if (// Is this a work in progress or an internal GUI component?
<<<<<<< HEAD:src/core/org/apache/jmeter/junit/JMeterTest.java
			(title != null && title.length() > 0) // Will be "" for internal components
					&& (title.toUpperCase().indexOf("(ALPHA") == -1) && (title.toUpperCase().indexOf("(BETA") == -1)
					&& (!title.equals("Example1")) // Skip the example samplers
													// ...
					&& (!title.equals("Example2"))) {// No, not a work in
														// progress ...
				String s = "component_reference.xml needs '" + title + "' anchor for " + guiItem.getClass().getName();
				if (!ct)
=======
			    (title != null && title.length() > 0) // Will be "" for internal components
				&& (title.toUpperCase().indexOf("(ALPHA") == -1) 
                )
                && (title.toUpperCase().indexOf("(BETA") == -1)
				&& (!title.equals("Example1")) // Skip the example samplers ...
				&& (!title.equals("Example2"))
                && (!name.startsWith("org.apache.jmeter.examples."))
            {// No, not a work in progress ...
                String s = "component_reference.xml needs '" + title + "' anchor for " + name;
				if (!ct) {
>>>>>>> 802e3dceda899abf235deef325c880bcbc1bb5f9:test/src/org/apache/jmeter/junit/JMeterTest.java
					log.warn(s); // Record in log as well
                }
				assertTrue(s, ct);
Solution content
                )
                && (!name.startsWith("org.apache.jmeter.examples."))
            }
            String name = guiItem.getClass().getName();
			if (// Is this a work in progress or an internal GUI component?
			    (title != null && title.length() > 0) // Will be "" for internal components
				&& (title.toUpperCase().indexOf("(ALPHA") == -1) 
                && (title.toUpperCase().indexOf("(BETA") == -1)
				&& (!title.equals("Example1")) // Skip the example samplers ...
				&& (!title.equals("Example2"))
            {// No, not a work in progress ...
                String s = "component_reference.xml needs '" + title + "' anchor for " + name;
				if (!ct) {
					log.warn(s); // Record in log as well
                }
				assertTrue(s, ct);
File
JMeterTest.java
Developer's decision
Version 2
Kind of conflict
Comment
If statement
Method invocation
Variable