<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Ismael Juma &#187; scala eclipse plugin</title>
	<atom:link href="http://blog.juma.me.uk/tag/scala-eclipse-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.juma.me.uk</link>
	<description></description>
	<lastBuildDate>Fri, 18 Nov 2011 00:09:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.juma.me.uk' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Ismael Juma &#187; scala eclipse plugin</title>
		<link>http://blog.juma.me.uk</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.juma.me.uk/osd.xml" title="Ismael Juma" />
	<atom:link rel='hub' href='http://blog.juma.me.uk/?pushpress=hub'/>
		<item>
		<title>Code reuse by copy and paste</title>
		<link>http://blog.juma.me.uk/2009/02/13/code-reuse-by-copy-and-paste/</link>
		<comments>http://blog.juma.me.uk/2009/02/13/code-reuse-by-copy-and-paste/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 20:15:48 +0000</pubDate>
		<dc:creator>Ismael Juma</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[code reuse]]></category>
		<category><![CDATA[copy and paste]]></category>
		<category><![CDATA[scala eclipse plugin]]></category>

		<guid isPermaLink="false">http://blog.juma.me.uk/?p=60</guid>
		<description><![CDATA[I was investigating what would need to be done to implement camel-case code assist for the Scala plugin when I ran across the following gem in CharOperation (Eclipse JDT): And in SearchPattern: I am sure there is a reason why this was done, but how ugly&#8230; Update: At least JDT made it easy to implement [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.juma.me.uk&amp;blog=4860094&amp;post=60&amp;subd=ijuma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was investigating what would need to be done to implement camel-case code assist for the Scala plugin when I ran across the following gem in CharOperation (Eclipse JDT):</p>
<p><pre class="brush: java;">
public static final boolean camelCaseMatch(char[] pattern, int patternStart, int patternEnd, char[] name, int nameStart, int nameEnd, boolean samePartCount) {

	/* !!!!!!!!!! WARNING !!!!!!!!!!
	 * The content of this method has been fully copied to
	 * SearchPattern#camelCaseMatch(String, int, int, String, int, int, boolean).
	 * 
	 * So, if current method is modified, do NOT forget to copy again its content
	 * to SearchPattern corresponding method!
	 */
</pre></p>
<p>And in SearchPattern:</p>
<p><pre class="brush: java;">
public static final boolean camelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd, boolean samePartCount) {

	/* !!!!!!!!!! WARNING !!!!!!!!!!
	 * The algorithm of this method has been entirely copied from
	 * CharOperation#camelCaseMatch(char[], int, int, char[], int, int, boolean).
	 * Array lengths have been replaced with call to {@link String#length()} and
	 * array direct access have been replaced with call to {@link String#charAt(int)}.
	 * 
	 * So, do NOT modify this method directly to fix any bug but modify first the
	 * corresponding CharOperation method and do the copy again to be sure that
	 * these two methods are kept synchronized.
	 */
</pre></p>
<p>I am sure there is a reason why this was done, but how ugly&#8230;</p>
<p><strong>Update: </strong> At least JDT made it easy to implement what I <a href="https://lampsvn.epfl.ch/trac/scala/ticket/1644#comment:1">wanted</a>.</p>
<br />Posted in eclipse, scala Tagged: code reuse, copy and paste, eclipse, scala eclipse plugin <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijuma.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijuma.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijuma.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijuma.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijuma.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijuma.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijuma.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijuma.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijuma.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijuma.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijuma.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijuma.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijuma.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijuma.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.juma.me.uk&amp;blog=4860094&amp;post=60&amp;subd=ijuma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.juma.me.uk/2009/02/13/code-reuse-by-copy-and-paste/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0eb053bf15b0a3669c973bc50be45a7c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijuma</media:title>
		</media:content>
	</item>
	</channel>
</rss>
