diff --git a/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceReader.java b/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceReader.java index 0f95ec8aed32..0accda716034 100644 --- a/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceReader.java +++ b/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceReader.java @@ -197,6 +197,12 @@ class CompilerReferenceReader { if (result.add(curClass)) { if (checkBaseClassAmbiguity || curClass != hierarchyElement) { final Collection definitionFiles = myIndex.getBackwardClassDefinitionMap().get(curClass); + if (definitionFiles == null) { + //diagnostic + String baseHierarchyElement = getNameEnumerator().getName(hierarchyElement.getName()); + String curHierarchyElement = getNameEnumerator().getName(curClass.getName()); + LOG.error("Can't get definition files for :" + curHierarchyElement + " base class: " + baseHierarchyElement); + } if (definitionFiles.size() != 1) { return null; } diff --git a/java/java-tests/testData/compiler/compilerReferenceFindUsages/testCompileTimeConstFindUsages/Bar.java b/java/java-tests/testData/compiler/compilerReferenceFindUsages/testCompileTimeConstFindUsages/Bar.java new file mode 100644 index 000000000000..20b98c7a7843 --- /dev/null +++ b/java/java-tests/testData/compiler/compilerReferenceFindUsages/testCompileTimeConstFindUsages/Bar.java @@ -0,0 +1,7 @@ +class Bar { + + void m() { + System.out.println(Foo.CONST); + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/compiler/compilerReferenceFindUsages/testCompileTimeConstFindUsages/Foo.java b/java/java-tests/testData/compiler/compilerReferenceFindUsages/testCompileTimeConstFindUsages/Foo.java new file mode 100644 index 000000000000..8c3531003e3b --- /dev/null +++ b/java/java-tests/testData/compiler/compilerReferenceFindUsages/testCompileTimeConstFindUsages/Foo.java @@ -0,0 +1,5 @@ +public class Foo { + + public static final String CONST = "value"; + +} \ No newline at end of file diff --git a/java/java-tests/testData/compiler/compilerReferenceFindUsages/testLibClassInJavaDocUsage/Foo.java b/java/java-tests/testData/compiler/compilerReferenceFindUsages/testLibClassInJavaDocUsage/Foo.java new file mode 100644 index 000000000000..5f97052cb35a --- /dev/null +++ b/java/java-tests/testData/compiler/compilerReferenceFindUsages/testLibClassInJavaDocUsage/Foo.java @@ -0,0 +1,6 @@ +/** + * {@link System} + */ +class Foo { + +} \ No newline at end of file diff --git a/java/java-tests/testData/compiler/compilerReferenceFindUsages/testLibClassUsage/Foo.java b/java/java-tests/testData/compiler/compilerReferenceFindUsages/testLibClassUsage/Foo.java new file mode 100644 index 000000000000..c9cec17836b8 --- /dev/null +++ b/java/java-tests/testData/compiler/compilerReferenceFindUsages/testLibClassUsage/Foo.java @@ -0,0 +1,7 @@ +class Foo { + + void m() { + System.out.println(""); + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/compiler/compilerReferenceFindUsages/testLibMethodUsage/Foo.java b/java/java-tests/testData/compiler/compilerReferenceFindUsages/testLibMethodUsage/Foo.java new file mode 100644 index 000000000000..44aa2d59a7aa --- /dev/null +++ b/java/java-tests/testData/compiler/compilerReferenceFindUsages/testLibMethodUsage/Foo.java @@ -0,0 +1,9 @@ +import java.util.Collections; + +class Foo { + + void m() { + Collections.emptyList(); + } + +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/compiler/CompilerReferencesFindUsagesTest.java b/java/java-tests/testSrc/com/intellij/compiler/CompilerReferencesFindUsagesTest.java index 30f3e7a58df1..ca7a37ffd20a 100644 --- a/java/java-tests/testSrc/com/intellij/compiler/CompilerReferencesFindUsagesTest.java +++ b/java/java-tests/testSrc/com/intellij/compiler/CompilerReferencesFindUsagesTest.java @@ -16,26 +16,81 @@ package com.intellij.compiler; import com.intellij.JavaTestUtil; +import com.intellij.codeInsight.daemon.DaemonAnalyzerTestCase; import com.intellij.lang.injection.InjectedLanguageManager; -import com.intellij.psi.PsiClass; -import com.intellij.psi.PsiReference; +import com.intellij.psi.*; import com.intellij.psi.impl.source.tree.injected.MyTestInjector; -import com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl; +import com.intellij.psi.search.searches.MethodReferencesSearch; import com.intellij.psi.search.searches.ReferencesSearch; +import com.intellij.testFramework.CompilerTester; import com.intellij.testFramework.SkipSlowTestLocally; @SkipSlowTestLocally -public class CompilerReferencesFindUsagesTest extends CompilerReferencesTestBase { +public class CompilerReferencesFindUsagesTest extends DaemonAnalyzerTestCase { + //TODO merge tests + private boolean myDefaultEnableState; + private CompilerTester myCompilerTester; + + @Override + public void setUp() throws Exception { + myDefaultEnableState = CompilerReferenceService.IS_ENABLED_KEY.asBoolean(); + CompilerReferenceService.IS_ENABLED_KEY.setValue(true); + super.setUp(); + myCompilerTester = new CompilerTester(myModule); + } + + @Override + public void tearDown() throws Exception { + try { + CompilerReferenceService.IS_ENABLED_KEY.setValue(myDefaultEnableState); + myCompilerTester.tearDown(); + } + finally { + myCompilerTester = null; + super.tearDown(); + } + } + protected String getTestDataPath() { return JavaTestUtil.getJavaTestDataPath() + "/compiler/compilerReferenceFindUsages/"; } - public void testFindUsagesInInjectedCode() { + public void testLibMethodUsage() throws Exception { + configureByFile(getName() + "/Foo.java"); + myCompilerTester.rebuild(); + PsiMethod methodToSearch = myJavaFacade.findClass(CommonClassNames.JAVA_UTIL_COLLECTIONS).findMethodsByName("emptyList", false)[0]; + assertOneElement(MethodReferencesSearch.search(methodToSearch).findAll()); + } + + public void testLibClassUsage() throws Exception { + configureByFile(getName() + "/Foo.java"); + myCompilerTester.rebuild(); + PsiClass classForSearch = myJavaFacade.findClass("java.lang.System"); + assertOneElement(ReferencesSearch.search(classForSearch).findAll()); + } + + public void testLibClassInJavaDocUsage() throws Exception { + configureByFile(getName() + "/Foo.java"); + myCompilerTester.rebuild(); + PsiClass classForSearch = myJavaFacade.findClass("java.lang.System"); + assertOneElement(ReferencesSearch.search(classForSearch).findAll()); + } + + public void testCompileTimeConstFindUsages() throws Exception { + configureByFiles(getName(), getName() + "/Bar.java", getName() + "/Foo.java"); + PsiField classForSearch = findClass("Foo").findFieldByName("CONST", false); + PsiElement referenceBefore = assertOneElement(ReferencesSearch.search(classForSearch).findAll()).getElement(); + myCompilerTester.rebuild(); + PsiElement referenceAfter = assertOneElement(ReferencesSearch.search(classForSearch).findAll()).getElement(); + assertTrue(referenceBefore == referenceAfter); + } + + public void testFindUsagesInInjectedCode() throws Exception { new MyTestInjector(getPsiManager()).injectAll(getTestRootDisposable()); - myFixture.configureByFile(getName() + "/Foo.java"); - rebuildProject(); - PsiClass classForSearch = myFixture.getJavaFacade().findClass("java.lang.System"); + configureByFile(getName() + "/Foo.java"); + myCompilerTester.rebuild(); + PsiClass classForSearch = myJavaFacade.findClass("java.lang.System"); PsiReference reference = assertOneElement(ReferencesSearch.search(classForSearch).findAll()); - assertTrue(InjectedLanguageManager.getInstance(getProject()).isInjectedFragment(((PsiReferenceExpressionImpl)reference).getContainingFile())); + assertTrue(InjectedLanguageManager.getInstance(getProject()).isInjectedFragment(reference.getElement().getContainingFile())); } } diff --git a/native/breakgen/CMakeLists.txt b/native/breakgen/CMakeLists.txt new file mode 100644 index 000000000000..90aa8a836f09 --- /dev/null +++ b/native/breakgen/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.1.0) +project(breakgen) + +include_directories($ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/win32) + +add_library(breakgen SHARED AppMain.c) \ No newline at end of file diff --git a/native/breakgen/breakgen.sln b/native/breakgen/breakgen.sln deleted file mode 100644 index c95280945f2d..000000000000 --- a/native/breakgen/breakgen.sln +++ /dev/null @@ -1,24 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "breakgen", "breakgen.vcxproj", "{AE14C87F-E99B-4363-BE34-917FAF98258F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AE14C87F-E99B-4363-BE34-917FAF98258F}.Debug|Win32.ActiveCfg = Debug|Win32 - {AE14C87F-E99B-4363-BE34-917FAF98258F}.Debug|Win32.Build.0 = Debug|Win32 - {AE14C87F-E99B-4363-BE34-917FAF98258F}.Debug|x64.ActiveCfg = Debug|x64 - {AE14C87F-E99B-4363-BE34-917FAF98258F}.Release|Win32.ActiveCfg = Release|Win32 - {AE14C87F-E99B-4363-BE34-917FAF98258F}.Release|Win32.Build.0 = Release|Win32 - {AE14C87F-E99B-4363-BE34-917FAF98258F}.Release|x64.ActiveCfg = Release|x64 - {AE14C87F-E99B-4363-BE34-917FAF98258F}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/native/breakgen/breakgen.vcproj b/native/breakgen/breakgen.vcproj deleted file mode 100644 index 4f02b6ace509..000000000000 --- a/native/breakgen/breakgen.vcproj +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/native/breakgen/breakgen.vcxproj b/native/breakgen/breakgen.vcxproj deleted file mode 100644 index 142d26a13fa0..000000000000 --- a/native/breakgen/breakgen.vcxproj +++ /dev/null @@ -1,157 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {AE14C87F-E99B-4363-BE34-917FAF98258F} - breakgen - Win32Proj - - - - DynamicLibrary - - - DynamicLibrary - - - DynamicLibrary - - - DynamicLibrary - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - Debug\ - true - ..\..\bin\win - true - $(Platform)\$(Configuration)\ - true - ..\..\bin\win - true - $(JdkPath)\include;$(IncludePath) - $(JdkPath)\include;$(IncludePath) - $(JdkPath)\include;$(IncludePath) - $(JdkPath)\include;$(IncludePath) - $(ProjectName)64 - - - - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BREAKGEN_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - $(JdkPath)\include;$(JdkPath)\include\win32;%(AdditionalIncludeDirectories) - - - true - Windows - MachineX86 - - - - - $(JdkPath)\include;$(JdkPath)\include\win32;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;BREAKGEN_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - true - Windows - true - true - MachineX86 - - - - - X64 - - - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;BREAKGEN_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - $(JdkPath)\include;$(JdkPath)\include\win32;%(AdditionalIncludeDirectories) - - - true - Windows - MachineX64 - - - - - X64 - - - $(JdkPath)\include;$(JdkPath)\include\win32;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;BREAKGEN_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - true - Windows - true - true - MachineX64 - - - - - - - - - \ No newline at end of file diff --git a/native/breakgen/breakgen.vcxproj.filters b/native/breakgen/breakgen.vcxproj.filters deleted file mode 100644 index 9c4507db840c..000000000000 --- a/native/breakgen/breakgen.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - \ No newline at end of file diff --git a/native/breakgen/build.cmd b/native/breakgen/build.cmd new file mode 100644 index 000000000000..d1a6a90b4e92 --- /dev/null +++ b/native/breakgen/build.cmd @@ -0,0 +1,22 @@ +SET CMAKE=%CMAKE_PATH%\bin\cmake + +RMDIR /S /Q build32 +MKDIR build32 +CD build32 +SET JAVA_HOME=%JDK_18% +"%CMAKE%" -G "Visual Studio 12 2013" -T v120_xp .. +IF ERRORLEVEL 1 EXIT 1 +"%CMAKE%" --build . --config Release +IF ERRORLEVEL 1 EXIT 2 +CD .. + +RMDIR /S /Q build64 +MKDIR build64 +CD build64 +SET JAVA_HOME=%JDK_18_x64% +"%CMAKE%" -G "Visual Studio 12 2013" -A x64 -T v120_xp .. +IF ERRORLEVEL 1 EXIT 3 +"%CMAKE%" --build . --config Release +IF ERRORLEVEL 1 EXIT 4 +RENAME Release\breakgen.dll breakgen64.dll +CD .. \ No newline at end of file diff --git a/platform/usageView/src/com/intellij/usages/UsageViewSettings.java b/platform/usageView/src/com/intellij/usages/UsageViewSettings.java index ccaf073792aa..280aa29d9e4f 100644 --- a/platform/usageView/src/com/intellij/usages/UsageViewSettings.java +++ b/platform/usageView/src/com/intellij/usages/UsageViewSettings.java @@ -38,7 +38,7 @@ public class UsageViewSettings implements PersistentStateComponentFunctionalExpressions to a class", e.getMessage()); + assertEquals("() -> {...} in Test will not compile after converting class FunctionalExpressions to a class", e.getMessage()); } } diff --git a/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java b/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java index 80b2681391fa..118cc1d54aa8 100644 --- a/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java +++ b/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java @@ -522,7 +522,8 @@ public class GitHistoryUtils { catch (Throwable t) { if (parseError.isNull()) { parseError.set(t); - LOG.error("Could not parse \" " + builder.toString() + "\"", t); + LOG.error("Could not parse \" " + StringUtil.escapeStringCharacters(builder.toString()) + "\"\n" + + "Command " + handler.printableCommandLine(), t); } } }, 0); @@ -537,23 +538,46 @@ public class GitHistoryUtils { int bufferSize) throws VcsException { final StringBuilder buffer = new StringBuilder(); + final Ref foundRecordEnd = Ref.create(false); final Ref ex = new Ref<>(); final AtomicInteger records = new AtomicInteger(); handler.addLineListener(new GitLineHandlerListener() { @Override public void onLineAvailable(String line, Key outputType) { try { + // format of the record is .*.* + // then next record goes + // (rather inconveniently, after RECORD_END there is a list of modified files) + // so here I'm trying to find text between two RECORD_START symbols + // that simultaneously contains a RECORD_END + // this helps to deal with commits like a929478f6720ac15d949117188cd6798b4a9c286 in linux repo that have RECORD_START symbols in the message + // wont help with RECORD_END symbols in the message however (have not seen those yet) + String tail = null; - int nextRecordStart = line.indexOf(GitLogParser.RECORD_START); - if (nextRecordStart == -1) { - buffer.append(line).append("\n"); + if (!foundRecordEnd.get()) { + int recordEnd = line.indexOf(GitLogParser.RECORD_END); + if (recordEnd != -1) { + foundRecordEnd.set(true); + buffer.append(line.substring(0, recordEnd + 1)); + line = line.substring(recordEnd + 1); + } + else { + buffer.append(line).append("\n"); + } } - else if (nextRecordStart == 0) { - tail = line + "\n"; - } - else { - buffer.append(line.substring(0, nextRecordStart)); - tail = line.substring(nextRecordStart) + "\n"; + + if (foundRecordEnd.get()) { + int nextRecordStart = line.indexOf(GitLogParser.RECORD_START); + if (nextRecordStart == -1) { + buffer.append(line).append("\n"); + } + else if (nextRecordStart == 0) { + tail = line + "\n"; + } + else { + buffer.append(line.substring(0, nextRecordStart)); + tail = line.substring(nextRecordStart) + "\n"; + } } if (tail != null) { @@ -562,6 +586,7 @@ public class GitHistoryUtils { buffer.setLength(0); } buffer.append(tail); + foundRecordEnd.set(false); } } catch (Exception e) { diff --git a/plugins/git4idea/tests/git4idea/history/GitHistoryUtilsTest.java b/plugins/git4idea/tests/git4idea/history/GitHistoryUtilsTest.java index d2f44686075c..fe9b0c1835a5 100644 --- a/plugins/git4idea/tests/git4idea/history/GitHistoryUtilsTest.java +++ b/plugins/git4idea/tests/git4idea/history/GitHistoryUtilsTest.java @@ -26,6 +26,8 @@ import com.intellij.util.ArrayUtil; import com.intellij.util.Consumer; import com.intellij.util.ExceptionUtil; import com.intellij.util.Function; +import com.intellij.util.containers.ContainerUtil; +import com.intellij.vcs.log.VcsFullCommitDetails; import com.intellij.vcsUtil.VcsUtil; import git4idea.GitFileRevision; import git4idea.GitRevisionNumber; @@ -134,7 +136,8 @@ public class GitHistoryUtilsTest extends GitSingleRepoTest { String[] parents; if (details.length > 2) { parents = details[2].split(" "); - } else { + } + else { parents = ArrayUtil.EMPTY_STRING_ARRAY; } final GitTestRevision revision = new GitTestRevision(details[0], details[1], parents, commitMessages[i], @@ -290,14 +293,14 @@ public class GitHistoryUtilsTest extends GitSingleRepoTest { @Test public void testGetCurrentRevision() throws Exception { - GitRevisionNumber revisionNumber = (GitRevisionNumber) GitHistoryUtils.getCurrentRevision(myProject, toFilePath(bfile), null); + GitRevisionNumber revisionNumber = (GitRevisionNumber)GitHistoryUtils.getCurrentRevision(myProject, toFilePath(bfile), null); assertEquals(revisionNumber.getRev(), myRevisions.get(0).myHash); assertEquals(revisionNumber.getTimestamp(), myRevisions.get(0).myDate); } @Test public void testGetCurrentRevisionInMasterBranch() throws Exception { - GitRevisionNumber revisionNumber = (GitRevisionNumber) GitHistoryUtils.getCurrentRevision(myProject, toFilePath(bfile), "master"); + GitRevisionNumber revisionNumber = (GitRevisionNumber)GitHistoryUtils.getCurrentRevision(myProject, toFilePath(bfile), "master"); assertEquals(revisionNumber.getRev(), myRevisions.get(0).myHash); assertEquals(revisionNumber.getTimestamp(), myRevisions.get(0).myDate); } @@ -309,7 +312,7 @@ public class GitHistoryUtilsTest extends GitSingleRepoTest { addCommit("new content"); final String[] output = log("master --pretty=%H#%at", "-n1").trim().split("#"); - GitRevisionNumber revisionNumber = (GitRevisionNumber) GitHistoryUtils.getCurrentRevision(myProject, toFilePath(bfile), "master"); + GitRevisionNumber revisionNumber = (GitRevisionNumber)GitHistoryUtils.getCurrentRevision(myProject, toFilePath(bfile), "master"); assertEquals(revisionNumber.getRev(), output[0]); assertEquals(revisionNumber.getTimestamp(), GitTestRevision.gitTimeStampToDate(output[1])); } @@ -323,7 +326,7 @@ public class GitHistoryUtilsTest extends GitSingleRepoTest { public void testGetLastRevisionForExistingFile() throws Exception { final ItemLatestState state = GitHistoryUtils.getLastRevision(myProject, toFilePath(bfile)); assertTrue(state.isItemExists()); - final GitRevisionNumber revisionNumber = (GitRevisionNumber) state.getNumber(); + final GitRevisionNumber revisionNumber = (GitRevisionNumber)state.getNumber(); assertEquals(revisionNumber.getRev(), myRevisions.get(0).myHash); assertEquals(revisionNumber.getTimestamp(), myRevisions.get(0).myDate); } @@ -378,7 +381,7 @@ public class GitHistoryUtilsTest extends GitSingleRepoTest { @Test public void testOnlyHashesHistory() throws Exception { - final List> history = GitHistoryUtils.onlyHashesHistory(myProject, toFilePath(bfile), myProjectRoot); + final List> history = GitHistoryUtils.onlyHashesHistory(myProject, toFilePath(bfile), myProjectRoot); assertEquals(history.size(), myRevisionsAfterRename.size()); Iterator itAfterRename = myRevisionsAfterRename.iterator(); for (Pair pair : history) { @@ -388,10 +391,25 @@ public class GitHistoryUtilsTest extends GitSingleRepoTest { } } + @Test + public void testLoadingDetailsWithU0001Character() throws Exception { + List details = ContainerUtil.newArrayList(); + + String message = "subject containing \u0001 symbol in it\n\ncommit body containing \u0001 symbol in it"; + touch("file.txt", "content"); + addCommit(message); + + GitHistoryUtils.loadAllDetails(myProject, myRepo.getRoot(), details::add); + + VcsFullCommitDetails lastCommit = ContainerUtil.getFirstItem(details); + assertNotNull(lastCommit); + assertEquals(message, lastCommit.getFullMessage()); + } + private void assertHistory(@NotNull List actualRevisions) throws IOException, VcsException { assertEquals("Incorrect number of commits in history", myRevisions.size(), actualRevisions.size()); for (int i = 0; i < actualRevisions.size(); i++) { - assertEqualRevisions((GitFileRevision) actualRevisions.get(i), myRevisions.get(i)); + assertEqualRevisions((GitFileRevision)actualRevisions.get(i), myRevisions.get(i)); } } @@ -424,7 +442,16 @@ public class GitHistoryUtilsTest extends GitSingleRepoTest { final byte[] myContent; private String[] myParents; - public GitTestRevision(String hash, String gitTimestamp, String[] parents, String commitMessage, String authorName, String authorEmail, String committerName, String committerEmail, String branch, String content) { + public GitTestRevision(String hash, + String gitTimestamp, + String[] parents, + String commitMessage, + String authorName, + String authorEmail, + String committerName, + String committerEmail, + String branch, + String content) { myHash = hash; myDate = gitTimeStampToDate(gitTimestamp); myParents = parents; @@ -443,8 +470,7 @@ public class GitHistoryUtilsTest extends GitSingleRepoTest { } public static Date gitTimeStampToDate(String gitTimestamp) { - return new Date(Long.parseLong(gitTimestamp)*1000); + return new Date(Long.parseLong(gitTimestamp) * 1000); } } - }