Gentoo Archives: gentoo-java

From: Martin von Gagern <Martin.vGagern@×××.net>
To: gentoo-dev@l.g.o, gentoo-java@l.g.o
Cc: Andrey Kislyuk <weaver@g.o>, Christian Faulhammer <fauli@g.o>
Subject: [gentoo-java] Re: Code review and main tree inclusion for java-mvn-src.eclass and java-pkg-simple.eclass
Date: Tue, 08 Dec 2009 10:26:25
Christian Faulhammer wrote:
> java-pkg-simple: > In my eyes, defining all local variables at the beginning of a function > makes it easier to read.
Sorry, Fauli, i totally missed your mail as it was only addressed to gentoo-dev, while I've been intently watching gentoo-java... java-pkg-simple_src_compile() was designed in a modular fashion, with blocks for compile, javadoc and package which are pretty much independent from one another. That's the reason why every one of these blocks has its own local variables, instead of a single set of locals for the whole function. Originally I wrote them as independent functions, and they might well be turned into such independent functions by adding a few function headers and braces. So if ever the need arises, that's what I'd do. Splitting locals would increase the footprint of such a change. From my #gentoo-java log from 2009-01-03: (11:24:36 UTC) MvG: java-pkg-simple_src_compile has five clear parts; would it make sense to place these in separate functions? This would allow more flexibility for ebuilds that want to use some but not all of these. (11:26:20 UTC) ali_bush: MvG: up to you, if they are clear, they could alway be separated out later To sum things up: yes, I could change the local declarations, but I'd rather keep things as they are, unless you object more vehemently. Greetings, Martin von Gagern (MvG)