From bf92ae9af455876a4353d1900006d00c0f78c134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 3 Feb 2017 12:39:15 -0300 Subject: [PATCH] Change EOLs --- .../pmd/lang/apex/ast/StackOverflowClass.cls | 258 +++++++++--------- 1 file changed, 129 insertions(+), 129 deletions(-) diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/StackOverflowClass.cls b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/StackOverflowClass.cls index aa65fc4299..2896906ffe 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/StackOverflowClass.cls +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/StackOverflowClass.cls @@ -1,129 +1,129 @@ -public class SomeClass { - - - public static boolean field1 = false; - public static boolean field2 = false; - - public static boolean field3 = false; - public static boolean field4 = false; - - - public static void onBeforeInsert(List object1List){ - onBeforeInsert_update1(object1List); - onBeforeInsert_update2(object1List); - } - - public static void onAfterInsert(Map object1Map){ - onAfterInsert_postSomething(); - } - - public static void onBeforeUpdate(Map oldObject1Map, Map newObject1Map){ - onBeforeUpdate_update3(newObject1Map.values()); - onBeforeUpdate_update4(newObject1Map.values()); - } - - public static void onAfterUpdate(Map oldObject1Map, Map newObject1Map){ - onAfterUpdate_postSomething(); - } - - - //----------- PRIVATE METHOD ---------- - private static Set objectIds; - private static List itemList; - private static List List1; - private static List List2; - - private static void onBeforeInsert_update2(List object1List){ - for(Object1__c object1 : object1List){ - String s = Something.getSomething(object1.Name); - if((String)object1.get(s) != null){ - object1.txt_ParentId__c = (String)object1.get(s); - } - } - } - - private static void onBeforeInsert_update1(List object1List){ - updateSomething(object1List); - } - - private static void onBeforeUpdate_update3(List object1List){ - for(Object1__c object1 : object1List){ - String s = Something.getSomething(object1.Name); - if((String)object1.get(s) != null){ - object1.txt_ParentId__c = (String)object1.get(s); - } - } - } - - private static void onBeforeUpdate_update4(List object1List){ - updateSomething(object1List); - } - - private static void onAfterInsert_postSomething(){ - - itemList = new List(); - itemToSomething1(); - itemToSomething2(); - insert itemList; - } - - private static void onAfterUpdate_postSomething(){ - itemList = new List(); - itemToSomething1(); - itemToSomething2(); - insert itemList; - } - - //-------------- HELPER FUNCTION ----------------- - private static void itemToSomething1(){ - if(!List1.isEmpty()){ - Map object1Map = new Map([SELECT Id, Name - FROM Object1__c - WHERE someId in: objectIds]); - - for(Object1__c object1 : List1){ - if(object1Map.get(object1.Id).Id != null && object1.Text != null){ - Item post = new Item(); - post.ParentId = object1Map.get(object1.Id).Id; - post.Body = "Something"; - - itemList.add(post); - } - } - } - } - - private static void itemToSomething2(){ - if(!List2.isEmpty()){ - for(Object1__c object1 : List2){ - if(object1.Text != null && object1.Id != null){ - Item post = new Item(); - post.ParentId = object1.Id; - post.Body = "Something"; - itemList.add(post); - } - } - } - } - - private static void updateSomething(List object1List){ - objectIds = new Set(); - List1 = new List(); - List2 = new List(); - - for(Object1__c object1 : object1List){ - if(object1.isSomething && object1.Text != null){ - objectIds.add(object1.Text); - List1.add(object1); - object1.isTrue = false; - object1.Date = System.now(); - } - - if(object1.isFalse){ - List2.add(object1); - object1.isTrue = false; - object1.Date = System.now(); - } - } - } -} +public class SomeClass { + + + public static boolean field1 = false; + public static boolean field2 = false; + + public static boolean field3 = false; + public static boolean field4 = false; + + + public static void onBeforeInsert(List object1List){ + onBeforeInsert_update1(object1List); + onBeforeInsert_update2(object1List); + } + + public static void onAfterInsert(Map object1Map){ + onAfterInsert_postSomething(); + } + + public static void onBeforeUpdate(Map oldObject1Map, Map newObject1Map){ + onBeforeUpdate_update3(newObject1Map.values()); + onBeforeUpdate_update4(newObject1Map.values()); + } + + public static void onAfterUpdate(Map oldObject1Map, Map newObject1Map){ + onAfterUpdate_postSomething(); + } + + + //----------- PRIVATE METHOD ---------- + private static Set objectIds; + private static List itemList; + private static List List1; + private static List List2; + + private static void onBeforeInsert_update2(List object1List){ + for(Object1__c object1 : object1List){ + String s = Something.getSomething(object1.Name); + if((String)object1.get(s) != null){ + object1.txt_ParentId__c = (String)object1.get(s); + } + } + } + + private static void onBeforeInsert_update1(List object1List){ + updateSomething(object1List); + } + + private static void onBeforeUpdate_update3(List object1List){ + for(Object1__c object1 : object1List){ + String s = Something.getSomething(object1.Name); + if((String)object1.get(s) != null){ + object1.txt_ParentId__c = (String)object1.get(s); + } + } + } + + private static void onBeforeUpdate_update4(List object1List){ + updateSomething(object1List); + } + + private static void onAfterInsert_postSomething(){ + + itemList = new List(); + itemToSomething1(); + itemToSomething2(); + insert itemList; + } + + private static void onAfterUpdate_postSomething(){ + itemList = new List(); + itemToSomething1(); + itemToSomething2(); + insert itemList; + } + + //-------------- HELPER FUNCTION ----------------- + private static void itemToSomething1(){ + if(!List1.isEmpty()){ + Map object1Map = new Map([SELECT Id, Name + FROM Object1__c + WHERE someId in: objectIds]); + + for(Object1__c object1 : List1){ + if(object1Map.get(object1.Id).Id != null && object1.Text != null){ + Item post = new Item(); + post.ParentId = object1Map.get(object1.Id).Id; + post.Body = "Something"; + + itemList.add(post); + } + } + } + } + + private static void itemToSomething2(){ + if(!List2.isEmpty()){ + for(Object1__c object1 : List2){ + if(object1.Text != null && object1.Id != null){ + Item post = new Item(); + post.ParentId = object1.Id; + post.Body = "Something"; + itemList.add(post); + } + } + } + } + + private static void updateSomething(List object1List){ + objectIds = new Set(); + List1 = new List(); + List2 = new List(); + + for(Object1__c object1 : object1List){ + if(object1.isSomething && object1.Text != null){ + objectIds.add(object1.Text); + List1.add(object1); + object1.isTrue = false; + object1.Date = System.now(); + } + + if(object1.isFalse){ + List2.add(object1); + object1.isTrue = false; + object1.Date = System.now(); + } + } + } +}