vazexqi / CodingSpectator

Watches and analyzes code edits in the Eclipse IDE non-invasively
http://codingspectator.cs.illinois.edu
Other
20 stars 14 forks source link

Make CodingSpectator support Eclipse Indigo SR1 #338

Closed reprogrammer closed 12 years ago

reprogrammer commented 12 years ago

We need to create another set of patches to support CodingSpectator on Eclipse Indigo SR1 (3.7.1). This issue relates to issues #327, #328, and #330.

reprogrammer commented 12 years ago

@Wanderer777

I followed the instructions at https://github.com/vazexqi/CodingSpectator/wiki/Supporting-Indigo-SR1 to patch "org.eclipse.ltk.core.refactoring" in bf4ef7e7326350a295356559aa62685acc2f0f4f.

reprogrammer commented 12 years ago

@Wanderer777:

I patched LTK and JDT plug-ins in 57249f872d714577becdc004009fe30c7f98e0e1 .. 125e98fab9a66f132ab9ddf101ec4f03f35cbef8. My next step is to test these patches.

reprogrammer commented 12 years ago

@Wanderer777:

The plug-in org.eclipse.jdt.core has been modified for CodingTracker only, but, I patched in anyways. However, the patch produced the following compilation problem. Would you fix this compilation problem in org.eclipse.jdt.core?

Description Resource    Path    Location    Type
resourceListener cannot be resolved or is not a field   Buffer.java /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core   line 401    Java Problem
reprogrammer commented 12 years ago

When I try to build the update site, I get the following error message:

eclipse.buildId=M20110909-1335
java.version=1.7.0_147-icedtea
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.rcp.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.rcp.product

Error
Thu Dec 22 20:47:25 CST 2011
Unable to find feature "org.eclipse.platform" with version in range [3.7.0,3.7.1).

Note that I'm building the update site from within Eclipse Indigo SR1 and the version of org.eclipse.platform that comes with Eclipse Indigo SR1 is 3.7.1.v201109091335.

Setting the imported version of org.eclipse.platform in edu.illinois.codingspectator.platform.patch/feature.xml to that of the one installed in Eclipse Indigo SR1 didn't fix the problem:

<requires>
  <import feature="org.eclipse.platform" version="3.7.1.r37x_v20110729-9gF7UHOxFtniV7mI3T556iZN9AU8bEZ1lHMcVK" patch="true"/>
</requires>

When I closed the org.eclipse.epp.usagedata.* bundles, the above error message disappeared. Perhaps it was wrong to assume that the copy of UDC bundles for Indigo were safe to use for Indigo SR1. I will investigate.

It seems that the problem is the license-feature-version attribute in org.eclipse.epp.usagedata.feature/feature.xml. The value of this attribute should be 3.7.1.qualifier not 3.7.0.qualifier in Eclipse Indigo SR1. Surprisingly, this attribute is 3.7.0.qualifier in the HEAD of the CVS repository as of Dec. 23, 2011. The version number of the UDC feature installed on Eclipse Indigo SR1 is org.eclipse.epp.usagedata.feature_1.4.0.R201106061540. This confirms that the UDC bundles haven't in Eclipse Indigo and Indigo SR1 are the same. However, the license-feature-version attribute in this version of this feature doesn't look right, at least for our purposes. So, I'm going to patch the feature for Eclipse Indigo SR1.

reprogrammer commented 12 years ago

When I tried to install CodingSpectator on Eclipse Indigo SR1, I got the following error message:

Cannot complete the install because one or more required items could not be found.
  Software being installed: CodingSpectator 1.0.0.201112230012 (edu.illinois.codingspectator.feature.group 1.0.0.201112230012)
  Missing requirement: edu.illinois.codingtracker.operations 1.0.0.201112230012 (edu.illinois.codingtracker.operations 1.0.0.201112230012) requires 'bundle edu.illinois.codingtracker.compare.helpers 0.0.0' but it could not be found
  Cannot satisfy dependency:
    From: CodingSpectator 1.0.0.201112230012 (edu.illinois.codingspectator.feature.group 1.0.0.201112230012)
    To: edu.illinois.codingtracker.feature.feature.group [1.0.0.201112230012]
  Cannot satisfy dependency:
    From: CodingTracker Feature 1.0.0.201112230012 (edu.illinois.codingtracker.feature.feature.group 1.0.0.201112230012)
    To: edu.illinois.codingtracker.operations [1.0.0.201112230012]

The plug-in edu.illinois.codingtracker.compare.helpers has to be included in the CodingTracker feature.

reprogrammer commented 12 years ago

Eclipse Indigo SR1 refused to install CodingSpectator because it couldn't verify the signed JARs. Eclipse generated the following exception in its error log during the installation of CodingSpectator:

java.security.SignatureException: An error occurred while processing the signatures for the file: /tmp/signatureFile6183059849499261382.jar
    at org.eclipse.osgi.internal.signedcontent.SignedBundleHook.getSignedContent(SignedBundleHook.java:260)
    at org.eclipse.equinox.internal.p2.artifact.repository.SignatureVerifier.verifyContent(SignatureVerifier.java:77)
    at org.eclipse.equinox.internal.p2.artifact.repository.SignatureVerifier.verify(SignatureVerifier.java:59)
    at org.eclipse.equinox.internal.p2.artifact.repository.SignatureVerifier.close(SignatureVerifier.java:100)
    at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.reportStatus(SimpleArtifactRepository.java:1132)
    at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.downloadArtifact(SimpleArtifactRepository.java:570)
    at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:680)
    at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.getArtifact(MirrorRequest.java:260)
    at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.transferSingle(MirrorRequest.java:235)
    at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.transfer(MirrorRequest.java:191)
    at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.perform(MirrorRequest.java:122)
    at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:664)
    at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifacts(SimpleArtifactRepository.java:735)
    at org.eclipse.equinox.internal.p2.engine.DownloadManager.fetch(DownloadManager.java:110)
    at org.eclipse.equinox.internal.p2.engine.DownloadManager.start(DownloadManager.java:99)
    at org.eclipse.equinox.internal.p2.engine.phases.Collect.completePhase(Collect.java:76)
    at org.eclipse.equinox.internal.p2.engine.Phase.postPerform(Phase.java:216)
    at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:84)
    at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:44)
    at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:75)
    at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
    at org.eclipse.equinox.p2.operations.ProvisioningSession.performProvisioningPlan(ProvisioningSession.java:174)
    at org.eclipse.equinox.p2.operations.ProfileModificationJob.runModal(ProfileModificationJob.java:79)
    at org.eclipse.equinox.p2.operations.ProvisioningJob.run(ProvisioningJob.java:177)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.security.SignatureException: Either the manifest file or the signature file has been tampered in this jar: /tmp/signatureFile6183059849499261382.jar
    at org.eclipse.osgi.internal.signedcontent.SignatureBlockProcessor.verifyManifestAndSignatureFile(SignatureBlockProcessor.java:154)
    at org.eclipse.osgi.internal.signedcontent.SignatureBlockProcessor.processSigner(SignatureBlockProcessor.java:104)
    at org.eclipse.osgi.internal.signedcontent.SignatureBlockProcessor.process(SignatureBlockProcessor.java:59)
    at org.eclipse.osgi.internal.signedcontent.SignedBundleFile.setBundleFile(SignedBundleFile.java:47)
    at org.eclipse.osgi.internal.signedcontent.SignedBundleHook.getSignedContent(SignedBundleHook.java:256)
    ... 24 more

The jarsigner program reports our JARs as invalid, too:

jarsigner -verify org.eclipse.jdt.ui_3.7.1.201112231000.jar 
jar verified.

Warning: 
This jar contains entries whose certificate chain is not validated.

Re-run with the -verbose and -certs options for more details.

The command jarsigner -verify -verbose -certs edu.illinois.codingspectator.data_1.0.0.201112231000.jar reported the following:

s        657 Fri Dec 23 10:03:12 CST 2011 META-INF/MANIFEST.MF

      X.509, CN=CodingSpectator Team, OU=Department of Computer Science, O=University of Illinois, L=Urbana, ST=Illinois, C=US
      [certificate is valid from 12/23/11 12:21 AM to 1/26/13 12:21 AM]
      [CertPath not validated: null]

         379 Fri Dec 23 10:03:12 CST 2011 META-INF/CODINGSP.SF
        1186 Fri Dec 23 10:03:12 CST 2011 META-INF/CODINGSP.DSA
           0 Fri Dec 23 10:01:36 CST 2011 META-INF/
           0 Fri Dec 23 10:01:06 CST 2011 edu/
           0 Fri Dec 23 10:01:06 CST 2011 edu/illinois/
           0 Fri Dec 23 10:01:06 CST 2011 edu/illinois/codingspectator/
           0 Fri Dec 23 10:01:06 CST 2011 edu/illinois/codingspectator/data/
sm      1725 Fri Dec 23 10:01:06 CST 2011 edu/illinois/codingspectator/data/CodingSpectatorDataPlugin.class

      X.509, CN=CodingSpectator Team, OU=Department of Computer Science, O=University of Illinois, L=Urbana, ST=Illinois, C=US
      [certificate is valid from 12/23/11 12:21 AM to 1/26/13 12:21 AM]
      [CertPath not validated: null]

  s = signature was verified 
  m = entry is listed in manifest
  k = at least one certificate was found in keystore
  i = at least one certificate was found in identity scope

jar verified.

Warning: 
This jar contains entries whose certificate chain is not validated.

I need to sign the JARs with Sun/Oracle JDK not OpenJDK (See http://stackoverflow.com/a/4344836/130224). I successfully signed the JARs using Sun JDK 6 but not Oracle JDK 7.