Permalink
Browse files

Suppress warning on parameter changed on override

  • Loading branch information...
1 parent 0109c15 commit 2877b4b8623eb31b91883d44294cdc2b8925bcbe @dodyg committed Feb 8, 2014
@@ -1,3 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project version="4" />
+<project version="4">
+ <component name="AndroidDexCompilerConfiguration">
+ <option name="OPTIMIZE" value="false" />
+ </component>
+</project>
@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package com.silverkeytech.news_engine.outlines
import java.util.ArrayList
+import android.util.Log
public class OpmlBuilder{
class object {
@@ -41,17 +42,25 @@ public class OpmlBuilder{
}
public class BodyBuilder (val opml : Opml){
+ class object {
+ public val TAG: String = javaClass<BodyBuilder>().getSimpleName()
+ }
+
var currentLevel = 0
var currentOutline = Outline()
var parentOutline : Outline? = null
var parents : ArrayList<Outline> = ArrayList<Outline>()
+ var counterLevelUp = 0
+ var counterLevelDown = 0
var rootOutlines : ArrayList<Outline>? = null
{
opml.body = Body()
rootOutlines = opml.body!!.outline
}
public fun startLevel(level : Int){
+ counterLevelUp++
+ Log.d(TAG, "Counter Level Up $counterLevelUp")
if (level == 0){
currentLevel = 0
currentOutline = Outline()
@@ -80,14 +89,20 @@ public class OpmlBuilder{
}
public fun endLevel(level : Int){
+ counterLevelDown++
if (level < currentLevel && level > 0){
parentOutline = parents.get(level - 1)
currentLevel = level
}
else if (level == 0){
currentLevel = 0
}
+ else {
+ val isEqual = level == currentLevel
+ Log.d(TAG, "Level $level is equal to $currentLevel $isEqual")
+ }
+ Log.d(TAG, "Counter Level Down $counterLevelDown")
}
public fun setText(text : String) { currentOutline.text = text }
@@ -25,10 +25,10 @@ import com.thebuzzmedia.sjxp.rule.DefaultRule
import com.silverkeytech.news_engine.xml.attributeRule
import com.silverkeytech.news_engine.xml.tagRule
-public class OpmlParser{
+public class OpmlParser {
public fun parse(input: InputStream, rss: OpmlBuilder) {
var items = arrayListOf<DefaultRule<OpmlBuilder>>(headTitle, headDateCreated, headDateModified, headOwnerName, headOwnerEmail)
- for (i in 0..15){
+ for (i in 0..15) {
items.add(outlineTag(i))
items.add(outlineAttributes(i))
}
@@ -39,7 +39,7 @@ public class OpmlParser{
val headTitle = textRule<OpmlBuilder>("/opml/head/title", {(text, opml) ->
opml.head.setTitle(text)
- })
+})
val headDateCreated = textRule<OpmlBuilder>("/opml/head/dateCreated", {(text, opml) ->
opml.head.setDateCreated(text)
@@ -57,9 +57,9 @@ val headOwnerEmail = textRule<OpmlBuilder>("/opml/head/ownerEmail", {(text, opml
opml.head.setOwnerEmail(text)
})
-fun outlineTag(level : Int) : DefaultRule<OpmlBuilder>{
+fun outlineTag(level: Int): DefaultRule<OpmlBuilder> {
if (level < 0)
- throw IllegalArgumentException()
+ throw IllegalArgumentException()
var path = "/opml/body"
for (i in 0..level)
@@ -74,7 +74,7 @@ fun outlineTag(level : Int) : DefaultRule<OpmlBuilder>{
}
//(path: String, action: (attrName: String, attrValue: String, rss: T) -> Unit, vararg attrNames: String?): DefaultRule<T>
-fun outlineAttributes(level : Int) : DefaultRule<OpmlBuilder>{
+fun outlineAttributes(level: Int): DefaultRule<OpmlBuilder> {
if (level < 0)
throw IllegalArgumentException()
@@ -83,7 +83,7 @@ fun outlineAttributes(level : Int) : DefaultRule<OpmlBuilder>{
path += "/outline"
return attributeRule<OpmlBuilder>(path, { attrName, attrValue, opml ->
- when(attrName){
+ when(attrName) {
"text" -> opml.body.setText(attrValue)
"url" -> opml.body.setUrl(attrValue)
"xmlUrl" -> opml.body.setXmlUrl(attrValue)
@@ -92,7 +92,8 @@ fun outlineAttributes(level : Int) : DefaultRule<OpmlBuilder>{
"name" -> opml.body.setName(attrValue)
"language" -> opml.body.setLanguage(attrValue)
"opmlUrl" -> opml.body.setOpmlUrl(attrValue)
- else -> { } //empty
+ else -> {
+ } //empty
}
}, "text", "url", "xmlUrl", "htmlUrl", "type", "name", "language", "opmlUrl")
}
@@ -29,6 +29,7 @@ public trait WithVisualModificationPanel{
open fun getActivity(): Activity
}
+[suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")]
public class ResizeTextActionMode (private val parent: WithVisualModificationPanel, private var mode: ActionMode?): ActionMode.Callback{
val INCREASE_SIZE = 1
val DECREASE_SIZE = 2
@@ -40,8 +40,8 @@ fun scrubHtml(text: String?): String {
if (text.isNullOrEmpty())
return ""
else {
- val text = text!!.trim().replaceAll("(<br>|<br/>)", "\n")
- val spanned = android.text.Html.fromHtml(text) as SpannableStringBuilder
+ val txt = text!!.trim().replaceAll("(<br>|<br/>)", "\n")
+ val spanned = android.text.Html.fromHtml(txt) as SpannableStringBuilder
val spannedObjects = spanned.getSpans(0, spanned.length(), javaClass<Any>())!!
for(i in 0..(spannedObjects.size - 1)){
@@ -30,6 +30,7 @@ import com.silverkeytech.android_rivers.Result
import com.silverkeytech.android_rivers.InfinityProgressDialog
import com.silverkeytech.android_rivers.R
+[suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")]
public class DeleteAllPodcastsAsync(it: Context?): AsyncTask<String, Int, Result<Int>>(){
class object {
public val TAG: String = javaClass<DeleteAllPodcastsAsync>().getSimpleName()
@@ -35,6 +35,7 @@ import com.silverkeytech.android_rivers.Result
import com.silverkeytech.android_rivers.R
import com.silverkeytech.android_rivers.httpGet
+[suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")]
public class DownloadBookmarksAsync(it: Context, ignoreCache: Boolean): AsyncTask<String, Int, Result<Opml>>(){
class object {
public val TAG: String = javaClass<DownloadBookmarksAsync>().getSimpleName()
@@ -40,6 +40,7 @@ import com.silverkeytech.android_rivers.PreferenceDefaults
import com.silverkeytech.android_rivers.makeLocalUrl
import com.silverkeytech.android_rivers.toHoursInMinutes
+[suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")]
public class DownloadCollectionAsRiverAsync(it: Context?, private val collectionId: Int): AsyncTask<String, Int, Result<List<RiverItemMeta>>>(){
class object {
public val TAG: String = javaClass<DownloadCollectionAsRiverAsync>().getSimpleName()
@@ -35,6 +35,7 @@ import com.silverkeytech.android_rivers.InfinityProgressDialog
import com.silverkeytech.android_rivers.daysBeforeNow
import com.silverkeytech.android_rivers.PreferenceDefaults
+[suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")]
public class DownloadFeedAsync(it: Context?, ignoreCache: Boolean): AsyncTask<String, Int, Result<SyndicationFeed>>(){
class object {
public val TAG: String = javaClass<DownloadFeedAsync>().getSimpleName()
@@ -43,6 +43,7 @@ import com.silverkeytech.android_rivers.findView
public data class DownloadedFile(val contentType: String, val filePath: String)
+[suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")]
public class DownloadImageAsync(it: Context?): AsyncTask<String, Int, Result<DownloadedFile>>(){
class object {
public val TAG: String = javaClass<DownloadImageAsync>().getSimpleName()
@@ -38,6 +38,7 @@ import com.silverkeytech.android_rivers.PreferenceDefaults
import com.silverkeytech.android_rivers.startOutlinerActivity
import com.silverkeytech.android_rivers.traverse
+[suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")]
public class DownloadOpmlAsync(it: Context?): AsyncTask<String, Int, Pair<String, Result<Opml>>>(){
class object {
public val TAG: String = javaClass<DownloadOpmlAsync>().getSimpleName()
@@ -32,6 +32,7 @@ import com.silverkeytech.android_rivers.InfinityProgressDialog
import com.silverkeytech.android_rivers.R
import com.silverkeytech.android_rivers.downloadSingleRiver
+[suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")]
//Responsible for handling a river js downloading and display in asynchronous way
public class DownloadRiverContentAsync(it: Context?, val language: String): AsyncTask<String, Int, Result<River>>(){
class object {
Oops, something went wrong.

0 comments on commit 2877b4b

Please sign in to comment.