Skip to content

Commit 025bce2

Browse files
committed
update project_information.txt
2 parents b2e1717 + 0856e09 commit 025bce2

File tree

1,522 files changed

+60580
-1581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,522 files changed

+60580
-1581
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ from open-source Java projects.
1818
| 7 | Csv | commons-csv | | 17 | 1-17 |
1919
| 8 | Gson | gson | | 18 | 1-18 |
2020
| 9 | JacksonCore | jackson-core | | 29 | 1-26,28-30 |
21-
| 10 | JacksonDatabind | jackson-databind | | 155 | 1-119,121-156 |
21+
| 10 | JacksonDatabind | jackson-databind | | 151 | 1-117,119,121-126,128-129,131-133,135-156 |
2222
| 11 | JacksonXml | jackson-dataformat-xml | | 12 | 1-12 |
2323
| 12 | Jsoup | jsoup | | 93 | 1-93 |
2424
| 13 | JxPath | commons-jxpath | | 22 | 1-22 |
Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
#-------------------------------------------------------------------------------
2+
# Copyright (c) 2014-2019 René Just, Darioush Jalali, and Defects4J contributors.
3+
#
4+
# Permission is hereby granted, free of charge, to any person obtaining a copy
5+
# of this software and associated documentation files (the "Software"), to deal
6+
# in the Software without restriction, including without limitation the rights
7+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
# copies of the Software, and to permit persons to whom the Software is
9+
# furnished to do so, subject to the following conditions:
10+
#
11+
# The above copyright notice and this permission notice shall be included in
12+
# all copies or substantial portions of the Software.
13+
#
14+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
# THE SOFTWARE.
21+
#-------------------------------------------------------------------------------
22+
23+
=pod
24+
25+
=head1 NAME
26+
27+
Project::MetaModel_core.pm -- L<Project> submodule for MetaModel-core.
28+
29+
=head1 DESCRIPTION
30+
31+
This module provides all project-specific configurations and subroutines for the
32+
MetaModel-core project.
33+
34+
=cut
35+
package Project::MetaModel_core;
36+
37+
use strict;
38+
use warnings;
39+
40+
use Constants;
41+
use Vcs::Git;
42+
43+
our @ISA = qw(Project);
44+
my $PID = "MetaModel_core";
45+
46+
sub new {
47+
@_ == 1 or die $ARG_ERROR;
48+
my ($class) = @_;
49+
50+
my $name = "MetaModel-core";
51+
my $vcs = Vcs::Git->new($PID,
52+
"$REPO_DIR/$name.git",
53+
"$PROJECTS_DIR/$PID/$BUGS_CSV_ACTIVE",
54+
\&_post_checkout);
55+
56+
return $class->SUPER::new($PID, $name, $vcs);
57+
}
58+
59+
##
60+
## Determines the directory layout for sources and tests
61+
##
62+
#sub determine_layout {
63+
# @_ == 2 or die $ARG_ERROR;
64+
# my ($self, $rev_id) = @_;
65+
# my $dir = $self->{prog_root};
66+
67+
# # Add additional layouts if necessary
68+
# my $result = _ant_layout($dir) // _maven_layout($dir);
69+
# die "Unknown layout for revision: ${rev_id}" unless defined $result;
70+
# return $result;
71+
#}
72+
73+
#
74+
# Post-checkout tasks include, for instance, providing cached build files,
75+
# fixing compilation errors, etc.
76+
#
77+
sub _post_checkout {
78+
my ($self, $rev_id, $work_dir,$SUBPROJ) = @_;
79+
#print("$SUBPROJ !\n");
80+
my $project_dir = "$PROJECTS_DIR/$self->{pid}";
81+
$work_dir.="/$SUBPROJ";
82+
# Check whether ant build file exists
83+
my $build_files_dir = "$PROJECTS_DIR/$PID/build_files/$rev_id";
84+
if (-d "$build_files_dir") {
85+
Utils::exec_cmd("cp -r $build_files_dir/* $work_dir", "Copy generated Ant build file") or die;
86+
}
87+
88+
if (-e "$work_dir/build.xml"){
89+
rename("$work_dir/build.xml", "$work_dir/build.xml".'.bak');
90+
open(IN, '<'."$work_dir/build.xml".'.bak') or die $!;
91+
open(OUT, '>'."$work_dir/build.xml") or die $!;
92+
while(<IN>) {
93+
94+
$_ =~ s/compile-tests/compile\.tests/g;
95+
#$_ =~ s/=src\//=$SUBPROJ\/src\//g;
96+
#$_ =~ s/classesdir/classes\.dir/g;
97+
#$_ =~ s/testclasses\.dir/test\.classes\.dir/g;
98+
99+
#support java8
100+
$_ =~ s/fork="false"/fork="true"/g;
101+
print OUT $_;
102+
}
103+
close(IN);
104+
close(OUT);
105+
}
106+
107+
if (-e "$work_dir/maven-build.xml"){
108+
rename("$work_dir/maven-build.xml", "$work_dir/maven-build.xml".'.bak');
109+
open(IN, '<'."$work_dir/maven-build.xml".'.bak') or die $!;
110+
open(OUT, '>'."$work_dir/maven-build.xml") or die $!;
111+
while(<IN>) {
112+
$_ =~ s/compile-tests/compile\.tests/g;
113+
#$_ =~ s/classesdir/classes\.dir/g;
114+
#$_ =~ s/testclasses\.dir/test\.classes\.dir/g;
115+
#$_ =~ s/src\//$SUBPROJ\/src\//g;
116+
#support java8
117+
$_ =~ s/fork="false"/fork="true"/g;
118+
print OUT $_;
119+
}
120+
close(IN);
121+
close(OUT);
122+
}
123+
if (-e "$work_dir/maven-build.properties"){
124+
rename("$work_dir/maven-build.properties", "$work_dir/maven-build.properties".'.bak');
125+
open(IN, '<'."$work_dir/maven-build.properties".'.bak') or die $!;
126+
open(OUT, '>'."$work_dir/maven-build.properties") or die $!;
127+
while(<IN>) {
128+
$_ =~ s/compile-tests/compile\.tests/g;
129+
#$_ =~ s/=src\//=$SUBPROJ\/src\//g;
130+
#$_ =~ s/classesdir/classes\.dir/g;
131+
#$_ =~ s/testclasses\.dir/test\.classes\.dir/g;
132+
133+
#support java8
134+
$_ =~ s/fork="false"/fork="true"/g;
135+
print OUT $_;
136+
}
137+
close(IN);
138+
close(OUT);
139+
}
140+
141+
#exclude the test you don't need
142+
my $exclude_test1="$work_dir/src/tests/junit/org/apache/tools/ant/taskdefs/xxx.java";
143+
if (-e $exclude_test1){
144+
rename($exclude_test1,$exclude_test1.".bak");
145+
#open(OUT, '>'.$exclude_test1) or die $!;
146+
#my $converted_file = `iconv -f iso-8859-1 -t utf-8 "$exclude_test1.bak"`;
147+
#print OUT $converted_file;
148+
#close(OUT);
149+
}
150+
151+
}
152+
153+
154+
#
155+
# This subroutine is called by the bug-mining framework for each revision during
156+
# the initialization of the project. Example uses are: converting and caching
157+
# build files or other time-consuming tasks, whose results should be cached.
158+
#
159+
sub initialize_revision {
160+
my ($self, $rev_id, $vid,$sub_project) = @_;
161+
$self->SUPER::initialize_revision($rev_id);
162+
163+
my $work_dir = $self->{prog_root};
164+
my $result = _ant_layout($work_dir) // _maven_layout($work_dir);
165+
166+
if (-e "$work_dir/src/main/java" and -e "$work_dir/src/test/java"){
167+
$result = {src=>"src/main/java", test=>"src/test/java"} unless defined $result;
168+
}
169+
elsif (-e "$work_dir/src/main/java" and -e "$work_dir/src/tests/java"){
170+
$result = {src=>"src/main/java", test=>"src/tests/java"} unless defined $result;
171+
}
172+
elsif (-e "$work_dir/src/main" and -e "$work_dir/src/testcases"){
173+
$result = {src=>"src/main", test=>"src/testcases"} unless defined $result;
174+
}
175+
elsif (-e "$work_dir/src/main" and -e "$work_dir/src/tests/junit"){
176+
$result = {src=>"src/main", test=>"src/tests/junit"} unless defined $result;
177+
}
178+
elsif (-e "$work_dir/src/main" and -e "$work_dir/src/tests"){
179+
$result = {src=>"src/main", test=>"src/tests"} unless defined $result;
180+
}
181+
elsif (-e "$work_dir/src/java" and -e "$work_dir/src/test"){
182+
$result = {src=>"src/java", test=>"src/test"} unless defined $result;
183+
}
184+
elsif (-e "$work_dir/src/java" and -e "$work_dir/src/tests"){
185+
$result = {src=>"src/java", test=>"src/tests"} unless defined $result;
186+
}
187+
else {
188+
if (-e "$work_dir"){
189+
system("tree -d $work_dir");
190+
die "Unknown directory layout" unless defined $result;
191+
}
192+
else {
193+
$result = {src=>"$sub_project", test=>"$sub_project"} unless defined $result;
194+
}
195+
}
196+
197+
$self->_add_to_layout_map($rev_id, $result->{src}, $result->{test});
198+
$self->_cache_layout_map(); # Force cache rebuild
199+
}
200+
201+
#
202+
# Distinguish between project layouts and determine src and test directories.
203+
# Each _layout subroutine returns undef if it doesn't match the layout of the
204+
# checked-out version. Otherwise, it returns a hash that provides the src and
205+
# test directory, relative to the working directory.
206+
#
207+
208+
#
209+
# Existing Ant build.xml and default.properties
210+
#
211+
sub _ant_layout {
212+
@_ == 1 or die $ARG_ERROR;
213+
my ($dir) = @_;
214+
my $src = `grep "source.home" $dir/default.properties 2>/dev/null`;
215+
my $test = `grep "test.home" $dir/default.properties 2>/dev/null`;
216+
217+
# Check whether this layout applies to the checked-out version
218+
return undef if ($src eq "" || $test eq "");
219+
220+
$src =~ s/\s*source.home\s*=\s*(\S+)\s*/$1/;
221+
$test=~ s/\s*test.home\s*=\s*(\S+)\s*/$1/;
222+
223+
return {src=>$src, test=>$test};
224+
}
225+
226+
#
227+
# Generated build.xml (from mvn ant:ant) with maven-build.properties
228+
#
229+
sub _maven_layout {
230+
@_ == 1 or die $ARG_ERROR;
231+
my ($dir) = @_;
232+
my $src = `grep "maven.build.srcDir.0" $dir/maven-build.properties 2>/dev/null`;
233+
my $test = `grep "maven.build.testDir.0" $dir/maven-build.properties 2>/dev/null`;
234+
235+
return undef if ($src eq "" || $test eq "");
236+
237+
$src =~ s/\s*maven\.build\.srcDir\.0\s*=\s*(\S+)\s*/$1/;
238+
$test=~ s/\s*maven\.build\.testDir\.0\s*=\s*(\S+)\s*/$1/;
239+
240+
return {src=>$src, test=>$test};
241+
}
242+
243+
1;

0 commit comments

Comments
 (0)