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
Message-Id: 4B1E294B.70906@gmx.net
1 Christian Faulhammer wrote:
2 > java-pkg-simple:
3 > In my eyes, defining all local variables at the beginning of a function
4 > makes it easier to read.
5
6 Sorry, Fauli, i totally missed your mail as it was only addressed to
7 gentoo-dev, while I've been intently watching gentoo-java...
8
9 java-pkg-simple_src_compile() was designed in a modular fashion, with
10 blocks for compile, javadoc and package which are pretty much
11 independent from one another. That's the reason why every one of these
12 blocks has its own local variables, instead of a single set of locals
13 for the whole function.
14
15 Originally I wrote them as independent functions, and they might well be
16 turned into such independent functions by adding a few function headers
17 and braces. So if ever the need arises, that's what I'd do. Splitting
18 locals would increase the footprint of such a change.
19
20 From my #gentoo-java log from 2009-01-03:
21 (11:24:36 UTC) MvG:
22 java-pkg-simple_src_compile has five clear parts; would it make sense to
23 place these in separate functions? This would allow more flexibility for
24 ebuilds that want to use some but not all of these.
25 (11:26:20 UTC) ali_bush:
26 MvG: up to you, if they are clear, they could alway be separated out later
27
28 To sum things up: yes, I could change the local declarations, but I'd
29 rather keep things as they are, unless you object more vehemently.
30
31 Greetings,
32 Martin von Gagern (MvG)