abaplint / abaplint-sci-client

ABAP part for running abaplint on ABAP backend
MIT License
38 stars 20 forks source link

Wrong error title in eclipse #256

Open OberstVonGatow opened 3 years ago

OberstVonGatow commented 3 years ago

Hi, we are using the new version 2.78 and getting wrong error titles in eclipse.

If we are using SE80 the Error titles are correct but if i use eclipse it seems like it have a cached old rule title table. I'm now pretty sure it has something to do with the new rule cyclic_oo, because i rule constructor_visibility_public and above are correct the first rule i could check is wrong is dangerous_statement. (i'm not sure how i could easily check cyclomatic_complexity).

Only the title is wrong the description is correct:

image

I debugged ZCL_ABAPLINT_CHECK till OUTPUT_ISSUES but everything seems to work just fine. 132 Rules (with cyclic_oo are found). But if i change the correct code LINT_028 to LINT_027 in the debugger the title and description is correct in eclipse.

I tried with a different eclipse and workspace but still the same issue. I really don't get where the titles are cached...

larshp commented 3 years ago

the part handling the mapping between abaplint and code inspector is https://github.com/abaplint/abaplint-sci-client/blob/main/src/zcl_abaplint_check.clas.abap#L187, but since its working in sap gui I guess its okay

hmm, maybe we should change the numbering to some hashing, to avoid this happening too often

larshp commented 3 years ago

try grep'ing the entire PC for "LINT_028", something like http://astrogrep.sourceforge.net can help, assuming you are on windows

OberstVonGatow commented 3 years ago

I tried astrogrep but got no luck. A colleague now has the same issue. Looking at the ADT Communication it looks like a adt "worklist" is saved for the runs but we still don't see where or how we could delete them.

OberstVonGatow commented 3 years ago

When i enable the ABAP Communication Log the Title is already wrong. adtcore:uri="/sap/bc/adt/atc/worklists/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0028/-1645094566" atcfinding:location="/sap/bc/adt/oo/classes/zcl_abap_naming/source/main#start=20,0" atcfinding:priority="1" atcfinding:checkId="4A301D339547D2B7393837CCE703C0FF" atcfinding:checkTitle="abaplint" atcfinding:messageId="LINT_0028" atcfinding:messageTitle="Database operation in loop"

Title should be from dangerous_statement instead of database operation in loop.

But i'm no ADT Professional don't know if there is still an eclipse cache somewhere. If the Message already wrong from the SCI it is strange, that everything is correct with SE80.

Whole Get Message: `====> GET /sap/bc/adt/atc/worklists/00505688CB501EDC83FADE4C62C48311?timestamp=1631021378&usedObjectSet=99999999999999999999999999999999&includeExemptedFindings=false HTTP/1.1 [ERP_DE1_200_schmidtf_de (300), stateless] --- REQUEST: GET /sap/bc/adt/atc/worklists/00505688CB501EDC83FADE4C62C48311?timestamp=1631021378&usedObjectSet=99999999999999999999999999999999&includeExemptedFindings=false HTTP/1.1 Accept: application/atc.worklist.v1+xml User-Agent: Eclipse/4.19.0.v20210303-1800 (win32; x86_64; Java 11.0.10) ADT/3.20.0 (devedition) X-sap-adt-profiling: server-time

--- RESPONSE: HTTP/1.1 200 OK ~server_protocol: HTTP/1.1 X-sap-adt-profiling: server-time=62208 Content-Type: application/atc.worklist.v1+xml; charset=utf-8

<?xml version="1.0" encoding="utf-8"?><atcworklist:worklist atcworklist:id="00505688CB501EDC83FADE4C62C48311" atcworklist:timestamp="2021-09-07T13:56:04Z" atcworklist:usedObjectSet="99999999999999999999999999999999" atcworklist:objectSetIsComplete="true" xmlns:atcworklist="http://www.sap.com/adt/atc/worklist"><atcworklist:objectSets><atcworklist:objectSet atcworklist:name="00000000000000000000000000000000" atcworklist:title="Alle Objekte" atcworklist:kind="ALL"/><atcworklist:objectSet atcworklist:name="99999999999999999999999999999999" atcworklist:title="Letzter Prüflauf" atcworklist:kind="LAST_RUN"/></atcworklist:objectSets><atcworklist:objects><atcobject:object adtcore:uri="/sap/bc/adt/atc/objects/R3TR/CLAS/ZCL_ABAP_NAMING" adtcore:type="CLAS" adtcore:name="ZCL_ABAP_NAMING" adtcore:packageName="$ABAP_NAMING" atcobject:author="SCHMIDTF" atcobject:objectTypeId="CLAS/OC" xmlns:atcobject="http://www.sap.com/adt/atc/object" xmlns:adtcore="http://www.sap.com/adt/core"><atcobject:findings><atcfinding:finding adtcore:uri="/sap/bc/adt/atc/worklists/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0123/-1575120413" atcfinding:location="/sap/bc/adt/oo/classes/zcl_abap_naming/source/main#start=11,0" atcfinding:priority="1" atcfinding:checkId="4A301D339547D2B7393837CCE703C0FF" atcfinding:checkTitle="abaplint" atcfinding:messageId="LINT_0123" atcfinding:messageTitle="Unused variables" atcfinding:exemptionApproval="" atcfinding:exemptionKind="" xmlns:atcfinding="http://www.sap.com/adt/atc/finding"><atom:link href="/sap/bc/adt/documentation/atc/documents/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0123/-1575120413" rel="http://www.sap.com/adt/relations/documentation" type="text/html" xmlns:atom="http://www.w3.org/2005/Atom"/></atcfinding:finding><atcfinding:finding adtcore:uri="/sap/bc/adt/atc/worklists/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0072/686886552" atcfinding:location="/sap/bc/adt/oo/classes/zcl_abap_naming/source/main#start=26,0" atcfinding:priority="1" atcfinding:checkId="4A301D339547D2B7393837CCE703C0FF" atcfinding:checkTitle="abaplint" atcfinding:messageId="LINT_0072" atcfinding:messageTitle="Method name overwrites builtin function" atcfinding:exemptionApproval="" atcfinding:exemptionKind="" xmlns:atcfinding="http://www.sap.com/adt/atc/finding"><atom:link href="/sap/bc/adt/documentation/atc/documents/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0072/686886552" rel="http://www.sap.com/adt/relations/documentation" type="text/html" xmlns:atom="http://www.w3.org/2005/Atom"/></atcfinding:finding><atcfinding:finding adtcore:uri="/sap/bc/adt/atc/worklists/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0028/-1645094566" atcfinding:location="/sap/bc/adt/oo/classes/zcl_abap_naming/source/main#start=20,0" atcfinding:priority="1" atcfinding:checkId="4A301D339547D2B7393837CCE703C0FF" atcfinding:checkTitle="abaplint" atcfinding:messageId="LINT_0028" atcfinding:messageTitle="Database operation in loop" atcfinding:exemptionApproval="" atcfinding:exemptionKind="" xmlns:atcfinding="http://www.sap.com/adt/atc/finding"><atom:link href="/sap/bc/adt/documentation/atc/documents/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0028/-1645094566" rel="http://www.sap.com/adt/relations/documentation" type="text/html" xmlns:atom="http://www.w3.org/2005/Atom"/></atcfinding:finding><atcfinding:finding adtcore:uri="/sap/bc/adt/atc/worklists/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0024/-604138774" atcfinding:location="/sap/bc/adt/oo/classes/zcl_abap_naming/source/main#start=10,0" atcfinding:priority="1" atcfinding:checkId="4A301D339547D2B7393837CCE703C0FF" atcfinding:checkTitle="abaplint" atcfinding:messageId="LINT_0024" atcfinding:messageTitle="Check constructor visibility is public" atcfinding:exemptionApproval="" atcfinding:exemptionKind="" xmlns:atcfinding="http://www.sap.com/adt/atc/finding"><atom:link href="/sap/bc/adt/documentation/atc/documents/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0024/-604138774" rel="http://www.sap.com/adt/relations/documentation" type="text/html" xmlns:atom="http://www.w3.org/2005/Atom"/></atcfinding:finding><atcfinding:finding adtcore:uri="/sap/bc/adt/atc/worklists/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0016/92972883" atcfinding:location="/sap/bc/adt/oo/classes/zcl_abap_naming/source/main#start=22,0" atcfinding:priority="2" atcfinding:checkId="4A301D339547D2B7393837CCE703C0FF" atcfinding:checkTitle="abaplint" atcfinding:messageId="LINT_0016" atcfinding:messageTitle="Check sy-subrc" atcfinding:exemptionApproval="" atcfinding:exemptionKind="" xmlns:atcfinding="http://www.sap.com/adt/atc/finding"><atom:link href="/sap/bc/adt/documentation/atc/documents/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0016/92972883" rel="http://www.sap.com/adt/relations/documentation" type="text/html" xmlns:atom="http://www.w3.org/2005/Atom"/></atcfinding:finding><atcfinding:finding adtcore:uri="/sap/bc/adt/atc/worklists/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0012/-388003295" atcfinding:location="/sap/bc/adt/oo/classes/zcl_abap_naming/source/main#start=18,0" atcfinding:priority="2" atcfinding:checkId="4A301D339547D2B7393837CCE703C0FF" atcfinding:checkTitle="abaplint" atcfinding:messageId="LINT_0012" atcfinding:messageTitle="Check Comments" atcfinding:exemptionApproval="" atcfinding:exemptionKind="" xmlns:atcfinding="http://www.sap.com/adt/atc/finding"><atom:link href="/sap/bc/adt/documentation/atc/documents/00505688CB501EDC83FADE4C62C48311/findings/ZCL_ABAP_NAMING/CLAS/4A301D339547D2B7393837CCE703C0FF/LINT_0012/-388003295" rel="http://www.sap.com/adt/relations/documentation" type="text/html" xmlns:atom="http://www.w3.org/2005/Atom"/></atcfinding:finding></atcobject:findings></atcobject:object></atcworklist:objects></atcworklist:worklist> --- REQUEST STACK TRACE (thread: Worker-34: Updating ATC worklist ERP_DE1_200_schmidtf_de ZABAPLINT)com.sap.adt.communication.internal.StackTrace at com.sap.adt.communication.http.internal.dispatcher.AbstractRequestDispatcher.notifyCycleFinished(AbstractRequestDispatcher.java:131) at com.sap.adt.communication.internal.jco.dispatcher.JCoRequestDispatcher.dispatch(JCoRequestDispatcher.java:107) at com.sap.adt.communication.internal.session.SystemSession.dispatchRequest(SystemSession.java:127) at com.sap.adt.communication.internal.session.SystemSession.sendRequest(SystemSession.java:122) at com.sap.adt.communication.internal.session.SystemSession.sendRequest(SystemSession.java:88) at com.sap.adt.communication.internal.resources.RestResource.invoke(RestResource.java:137) at com.sap.adt.communication.internal.resources.RestResource.get(RestResource.java:66) at com.sap.adt.atc.internal.worklist.AtcWorklistBackendAccess.getWorklist(AtcWorklistBackendAccess.java:141) at com.sap.adt.atc.ui.internal.launch.worklist.AtcGetWorklistJob.run(AtcGetWorklistJob.java:77) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

<====`

OberstVonGatow commented 3 years ago

We just figured out that the problem only appears when our eclipse login language is german (DE). If we are logging in with (EN) it works in Eclipse. In SE80 it works with german or english language. Do you have any idea where the problem could coming from?

larshp commented 3 years ago

nah, there is only the cache part, as mentioned above, image

OberstVonGatow commented 3 years ago

Found it finally after debugging almost everything in ATD/ADT... In Class CL_SATC_ADT_CI_TITLE_ACCESS is in the local implementation the method require_Cached_Documentation where method read_From_Shared_Memory is called. So the Titles are stored in a shared buffer.

If you skip the read_from_shared_memory in the debugger the new generated titles are correct.

image

larshp commented 3 years ago

well, its not closed, the problem still exists?

perhaps we can clear the buffer from custom code?

OberstVonGatow commented 1 year ago

Got this exact error again after an abapLint update. Jumping to "clear result." again helped 🤔 But still not quite sure how and when to clear the buffer from custom code. I think the buffer is quite useful most of the time. As i said i only got false buffer after updating abaplint from the repo.