Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - Synthetic accessor method warning -


i've made new warning settings in eclipse. these new settings i'm facing strange warning. after reading got know couldn't find way remove it.

here problem sample code

public class test {     private string teststring;      public void performaction() {          new thread( new runnable() {             @override             public void run() {                 teststring = "initialize"; // **             }         });     } } 

the line ** gives me warning in eclipse

read access enclosing field test.teststring emulated synthetic accessor method.  increasing visibility improve performance. 

problem is, don't want change access modifier of teststring. also, don't want create getter it.

what change should done?


more descriptive example   public class synthetic {     private jbutton testbutton;      public synthetic()     {         testbutton = new jbutton("run");         testbutton.addactionlistener(new actionlistener() {                 public void actionperformed(actionevent ae)                 {                     /* sample code */                     if( testbutton.gettext().equals("pause") ) {                         resetbutton(); // **                         } else if( testbutton.gettext().equals("run") ) {                         testbutton.settext("pause"); // **                       }                  }             }         );     }      public void reset() {         //some operations         resetbutton();     }      private void resetbutton() {         testbutton.settext("run");     } } 

lines ** gives me same warning.

in second example not necessary access testbutton directly; can access retrieving source of action event.

for resetbutton() method can add argument pass object act upon, if you've done not such big problem lowering access restrictions.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -