aaschmid / gradle-cpd-plugin

Gradle plugin to find duplicate code using PMDs copy/paste detection (= CPD).
Apache License 2.0
95 stars 12 forks source link

Comments not ignored when language is set to Kotlin #38

Closed isuPatches closed 5 years ago

isuPatches commented 5 years ago

Could use some help...when I change:

cpd {
    language = 'java'
}

to:

cpd {
    language = 'kotlin'
}

Then comment blocks such as:

/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

are labled as duplicate code.

aaschmid commented 5 years ago

Analysis: 1) If I use language java, I will get a lexical error. And if I skip them as well (setting skipLexicalErrors) no duplications are found at all. 2) Create some *.java files containing duplicate comments still results in now duplicates. 3) Extending the files with some duplicate code, the duplicates are shown (This is reproducable with the standalone version from https://pmd.github.io/latest/pmd_userdocs_cpd.html#examples.) 4) Next switching to kotlin. (The *.java files are ignored, only *.kt files seems to be considered.) The duplicates in comments appear. This is not reproducable** using the standalone version from https://pmd.github.io/latest/pmd_userdocs_cpd.html#examples. 5) If one uses --language kt in standalone version the duplicates in comments are part of the result.

=> I assume that kt is somehow an invalid language and therefore no or and incorrect parser is used. Some could be the reason using gradle-cpd-plugin.

Note: All tests have been done with PMD version 6.13.0.

aaschmid commented 5 years ago

Please also note @isuPatches that pmd-kotlin is available since 6.10.0 such that not in 6.8.0 which is used in https://github.com/isuPatches/WiseFy/pull/121/files#diff-a64dfe2d629b6972b45671eb3a81a735. Using the 6.8.0 standalone, no results at all are produced setting the language to kotlin...

isuPatches commented 5 years ago

Thank you!

aaschmid commented 5 years ago

Still having some issues with ANTLR runtime ... cannot reproduce it. The thrown exception has the following cause:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.pmd.lang.kotlin.antlr4.Kotlin
        at net.sourceforge.pmd.cpd.KotlinTokenizer.getLexerForSource(KotlinTokenizer.java:22)
        at net.sourceforge.pmd.cpd.AntlrTokenizer.tokenize(AntlrTokenizer.java:30)
        at net.sourceforge.pmd.cpd.CPD.addAndThrowLexicalError(CPD.java:142)
        at net.sourceforge.pmd.cpd.CPD.add(CPD.java:137)
        at net.sourceforge.pmd.cpd.CPD.add(CPD.java:107)
        at de.aaschmid.gradle.plugins.cpd.internal.CpdExecutor.run(CpdExecutor.java:79)

@isuPatches can you try using my snapshot version on your machine by adding the following to your buildscript section:

    project.ext {
        //...
        cpd_version = '1.4-SNAPSHOT'
        //...
    }
    repositories {
        //...
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        //...
    }
    //...
}

I am looking forward to your feedback...

isuPatches commented 5 years ago

I did a test using the 1.4-SNAPSHOT.

With tool version set to toolVersion = '6.13.0'

I see this:

<?xml version="1.0" encoding="UTF-8"?>
<pmd-cpd>
   <duplication lines="21" tokens="128">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/CallingThread.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/WiseFyThread.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.annotations

import java.lang.annotation.Inherited

/**
 * Denotes that a method is executed on the calling thread.]]></codefragment>
   </duplication>
   <duplication lines="21" tokens="125">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/CallingThread.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/Async.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/Sync.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/WiseFyThread.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.annotations

import java.lang.annotation.Inherited

/**
 * Denotes that a method is executed on the calling thread.]]></codefragment>
   </duplication>
   <duplication lines="21" tokens="124">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworksCallbacks.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.callbacks

import android.net.wifi.WifiConfiguration

/**
 * Callbacks for retrieving a saved network on a device.]]></codefragment>
   </duplication>
   <duplication lines="21" tokens="124">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointCallbacks.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.callbacks

import android.net.wifi.ScanResult

/**
 * Callbacks for finding a list of nearby access points on a device.]]></codefragment>
   </duplication>
   <duplication lines="21" tokens="124">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/CallingThread.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/Async.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/WaitsForTimeout.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/Sync.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/WiseFyThread.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.annotations

import java.lang.annotation.Inherited

/**
 * Denotes that a method is executed on the calling thread.]]></codefragment>
   </duplication>
   <duplication lines="21" tokens="123">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/CallingThread.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/Async.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/WaitsForTimeout.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/Sync.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/PublicAPI.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/WiseFyThread.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.annotations

import java.lang.annotation.Inherited

/**
 * Denotes that a method is executed on the calling thread.]]></codefragment>
   </duplication>
   <duplication lines="21" tokens="122">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetNearbyAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointCallbacks.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.callbacks

import android.net.wifi.ScanResult

/**
 * Callbacks for retrieving a list of nearby access points.]]></codefragment>
   </duplication>
   <duplication lines="21" tokens="122">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/AddNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworksCallbacks.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.callbacks

import android.net.wifi.WifiConfiguration

/**
 * Callbacks for retrieving a saved network on a device.]]></codefragment>
   </duplication>
   <duplication lines="19" tokens="122">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForSSIDCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForSSIDsCallbacks.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.callbacks

/**
 * Callbacks for finding a nearby SSID on a device.]]></codefragment>
   </duplication>
   <duplication lines="19" tokens="121">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetFrequencyCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetRSSICallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetIPCallbacks.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.callbacks

/**
 * Callbacks for retrieving the frequency of a network.]]></codefragment>
   </duplication>
   <duplication lines="19" tokens="120">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/RemoveNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetFrequencyCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/DisableWifiCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/DisconnectFromCurrentNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForSSIDCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForSSIDsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/ConnectToNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/EnableWifiCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetRSSICallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetIPCallbacks.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.callbacks

/**
 * Callbacks for removing a saved network on a device.]]></codefragment>
   </duplication>
   <duplication lines="19" tokens="118">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLoggingStrategy.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLogger.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.logging

/**
 * An interface for different logging options for implementation.]]></codefragment>
   </duplication>
   <duplication lines="19" tokens="117">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFySearch.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyPrechecks.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy

import android.Manifest.permission.ACCESS_WIFI_STATE
import android.net.wifi.ScanResult]]></codefragment>
   </duplication>
   <duplication lines="16" tokens="116">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFy.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/constants/WiseFyCodes.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/constants/NetworkTypes.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/constants/Capabilities.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
@file:JvmName("WiseFy")]]></codefragment>
   </duplication>
   <duplication lines="18" tokens="115">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetNearbyAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetCurrentNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/BaseCallback.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetCurrentNetworkInfoCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/AddNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworksCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointCallbacks.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.callbacks

import android.net.wifi.ScanResult]]></codefragment>
   </duplication>
   <duplication lines="18" tokens="115">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFySearch.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyConnection.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyPrechecks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WisePublicApi.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy

import android.Manifest.permission.ACCESS_WIFI_STATE]]></codefragment>
   </duplication>
   <duplication lines="18" tokens="115">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/StringUtil.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/WifiConfigurationUtil.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.utils

import com.isupatches.wisefy.constants.QUOTE]]></codefragment>
   </duplication>
   <duplication lines="16" tokens="114">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/RemoveNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetFrequencyCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetNearbyAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetCurrentNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/BaseCallback.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/DisableWifiCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/DisconnectFromCurrentNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForSSIDCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetCurrentNetworkInfoCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/AddNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForSSIDsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/ConnectToNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/EnableWifiCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetRSSICallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworksCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetIPCallbacks.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.callbacks]]></codefragment>
   </duplication>
   <duplication lines="16" tokens="114">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFySearch.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyLock.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyConnection.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyPrechecks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WisePublicApi.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy]]></codefragment>
   </duplication>
   <duplication lines="16" tokens="114">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/SleepUtil.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/StringUtil.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/WifiConfigurationUtil.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.utils]]></codefragment>
   </duplication>
   <duplication lines="16" tokens="114">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLoggingStrategy.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLogger.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLoggerImplementation.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.logging]]></codefragment>
   </duplication>
   <duplication lines="16" tokens="113">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/RemoveNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetFrequencyCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetNearbyAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetCurrentNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/BaseCallback.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/DisableWifiCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/DisconnectFromCurrentNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForSSIDCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetCurrentNetworkInfoCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/AddNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForSSIDsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/ConnectToNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/EnableWifiCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetRSSICallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworksCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetIPCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/constants/Symbols.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFySearch.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyLock.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/SleepUtil.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/StringUtil.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/WifiConfigurationUtil.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/CallingThread.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/Async.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/WaitsForTimeout.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/Sync.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/PublicAPI.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/WiseFyThread.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/threads/WiseFyHandlerThread.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyConnection.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyPrechecks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WisePublicApi.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLoggingStrategy.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLogger.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLoggerImplementation.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.isupatches.wisefy.callbacks]]></codefragment>
   </duplication>
   <duplication lines="15" tokens="112">
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFy.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/RemoveNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetFrequencyCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetNearbyAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetCurrentNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/BaseCallback.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/DisableWifiCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/DisconnectFromCurrentNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForSSIDCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetCurrentNetworkInfoCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/AddNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForSSIDsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/ConnectToNetworkCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/EnableWifiCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointsCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetRSSICallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetSavedNetworksCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/SearchForAccessPointCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/callbacks/GetIPCallbacks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/constants/WiseFyCodes.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/constants/NetworkTypes.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/constants/Capabilities.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/constants/Symbols.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFySearch.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyLock.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/SleepUtil.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/StringUtil.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/utils/WifiConfigurationUtil.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/CallingThread.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/Async.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/WaitsForTimeout.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/Sync.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/PublicAPI.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/annotations/WiseFyThread.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/threads/WiseFyHandlerThread.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyConnection.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFyPrechecks.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WisePublicApi.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLoggingStrategy.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLogger.kt"/>
      <file line="1"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLoggerImplementation.kt"/>
      <codefragment><![CDATA[/*
 * Copyright 2018 Patches Klinefelter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */]]></codefragment>
   </duplication>
   <duplication lines="12" tokens="98">
      <file line="1798"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFy.kt"/>
      <file line="1830"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFy.kt"/>
      <codefragment><![CDATA[    }

    /**
     * To return the first access point that matches a given regex.
     *
     *
     * *NOTE* Setting filterDuplicates to true will not return an access point with a weaker signal strength (will always take the highest).
     *
     * @param regexForSSID The regex to use when iterating through nearby access points
     * @param timeoutInMillis The amount of time (in milliseconds) to wait for a matching access point
     * @param filterDuplicates If you want to exclude access points with the same name that have a weaker signal strength
     *]]></codefragment>
   </duplication>
   <duplication lines="11" tokens="84">
      <file line="1131"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFy.kt"/>
      <file line="1161"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFy.kt"/>
      <codefragment><![CDATA[    }

    /**
     * To retrieve the RSSI of the first network matching a given regex.
     *
     * *NOTE* Setting takeHighest to true will return the access point with the highest RSSI for the given SSID.
     *
     * @param regexForSSID The regex to be used to search for the ssid
     * @param takeHighest Whether to return the access point with the highest RSSI for the given SSID
     * @param timeoutInMillis The amount of time to search for a matching SSID
     *]]></codefragment>
   </duplication>
   <duplication lines="11" tokens="78">
      <file line="1878"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFy.kt"/>
      <file line="1905"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/WiseFy.kt"/>
      <codefragment><![CDATA[    }

    /**
     * To return nearby access points that match a given regex.
     *
     *
     * *NOTE* Setting filterDuplicates to true will not return access points with a weaker signal strength (will always take the highest).
     *
     * @param regexForSSID The regex to use when iterating through nearby access points
     * @param filterDuplicates If you want to exclude access points with the same name that have a weaker signal strength
     *]]></codefragment>
   </duplication>
   <duplication lines="11" tokens="57">
      <file line="93"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLogger.kt"/>
      <file line="74"
            path="/Users/patches/Documents/GitHub/WiseFy/wisefy/src/main/java/com/isupatches/wisefy/logging/WiseFyLoggerImplementation.kt"/>
      <codefragment><![CDATA[    }

    /**
     * Logs an error message with a throwable.
     *
     * @param tag The tag for the log message
     * @param throwable A throwable to log with the message
     * @param message The message to log (can include placeholders)
     * @param args The formatting arguments for the log message
     *
     * @see [ensureWiseFyLoggerImplementationExists]]]></codefragment>
   </duplication>
</pmd-cpd>

Without the tool version set I see:

'Could not detect CPD language for 'kotlin', using any language as fallback.'

aaschmid commented 5 years ago

Very strange, my explicitly added test cases failed before and worked after the change ... Just to be sure: using toolVersion no warning is shown, correct? Thanks for testing @isuPatches. Can you also use Gradle without Daemon? Command line option is --no-daemon.

aaschmid commented 5 years ago

Update: @isuPatches, you can also check the newest 1.4-SNAPSHOT version. It is still WIP but works properly on my machine with your code :-)

If you give me a go, I can create a new release ;-)

isuPatches commented 5 years ago

Hey! I took another look at this.

I've tried:

It looks like comments are no longer being flagged as duplicate, so looks okay to me now!

Thank you.

aaschmid commented 5 years ago

@isuPatches Thanks for testing and coming back.

May I ask you another favor to test version 2.0-SNAPSHOT. I decided to bring all the new stuff with 2.0 as a lot of things changed internally...

isuPatches commented 5 years ago

Sure! I tried to pull it locally but am getting:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'WiseFy'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find de.aaschmid:gradle-cpd-plugin:2.0-SNAPSHOT.
     Searched in the following locations:
aaschmid commented 5 years ago

Thanks for the reply. It seems that the first upload of version 2.0-SNAPSHOT failed, after re-download I could successfully try it with my reproducer.

Could you try again? (Sorry for the inconveniences)

isuPatches commented 5 years ago

2.0-SNAPSHOT looks clear of the comment issue! The only thing I'm seeing that's unexpected is:

WARNING: Due to the absence of 'LifecycleBasePlugin' on project ':wisefysample' the task ':cpdCheck' could not be added to task graph. Therefore CPD will not be executed. To prevent this, manually add a task dependency of ':cpdCheck' to a 'check' task of a subproject.
1) Directly to project ':wisefy':
    check.dependsOn(':cpdCheck')
2) Indirectly, e.g. via project ':wisefysample':
    project(':wisefy') {
        plugins.withType(LifecycleBasePlugin) { // <- just required if 'java' plugin is applied within subproject
            check.dependsOn(cpdCheck)
        }
    }

I'm not sure if the SNAPSHOT includes the fix for that issue.