NetBeansNewfeaturesandimprovementsinthenextreleaseofNetBeansmakeitabetterIDEforanykindofdeveloper.
Fromeditingtobrowsing,versioning,building,debugging,profilingorvisualdesign,therearegreatnewsforeverybody.
NewCoreFeaturesinDepthOsvaldoDoederlein6.
0IssueThreeNNetBeans6.
0:NewCoreFeaturesinDepthIt'sthattimeagain.
Amajor,dot-zeroreleaseofNetBeanswillbeavailablesoon–aboutayearandahalfafter5.
0,whichintroducedsignificantnewfeaturesliketheMatisseGUIbuilder,andextensiveimprovementsinCVSintegration,webservicesandmoduledevelopment,tocitebutafew.
Incontrast,version5.
5focusedoutsidethecoreIDEbysupportingseveralnewPacksthatincreasedNetBeans'over-allfunctionalitytoalevelstillunmatchedbyanyotheropen-sourceIDE.
Now,isNetBeans6.
0worthyofthebumpinthemajorversionnumberYoubetitis,andinthisarticlewe'lllookatsomeofthemostimportantandinterestingnewfeaturesinthecoreIDE.
Javac-poweredLet'sbeginbylookingnotatanend-userfeaturebutatacoreIDEtechnologythatprovidesthefoundationformanyenhance-ments.
PastreleasesofNetBeans,likemanyotherprogrammingtools,containedcustomcodetoparseJavasourcesandassistincodeunderstandingandmanipula-tiontasks(likerefactorings,hintsandfixes,outlining,etc).
Theresultwassometimeslimitedfunctionality:simplehighlighting,non-bulletproofrefactorings,andthelackofsupportforfeatureslikecodecomple-tioneverywhereJavacodeappears.
TheobvioussolutionwouldbereusingthematuretechnologyofthejavaccompilertodoallJavasourceprocessing.
ButjavacwasnotdesignedtosupporttherequirementsofamodernIDE:itwaswrittenandtunedforbatchexecution,andtoacceptasinputfullcompilationunits,performacompletecom-pilationandproduce.
classfilesasoutput.
IDEshaveverydifferentrequirements,amongwhichthemostcriti-calisworkinginmemoryonly.
Supposethataftereachcharacteryoutype,theIDEwantstoanalyzetheentireclassagainsoitcanupdatesyntaxerrorindications,performhighlighting,andprovideotherfeaturesthatdependonthecodestructure.
Oneoptionwouldbetowritetheeditor'scurrentcontenttoatemporaryfile,invokejavacandparsetheresulting.
classfiles.
Butthiswouldbeveryinefficient.
Amuchbettersolutionistocalljavacinthesameprocess(asalocallibrary),thenpassthecurrentsourcesasanin-memoryparam-eterandreceiveinreturnthedatastructurescontainingthesameinformationthatwouldbepresentintheclassfiles(whichwouldn'tneedtobecreated).
UptoJavaSE5,thissolutionwouldbepos-sible,butonlyusingtheproprietary–andoftenunstable–internalAPIsofaJavacompiler.
ThissituationchangedwithJavaSE6,whichintroducedJSR199(JavaCompilerAPI)andJSR269(PluggableAnnotationProcess-ingAPI).
TheJavaCompilerAPIenablestightandefficientintegra-tionwithjavac(andotherJavasourcecompilers),andJSR269–althoughinitiallydesignedforannotationprocessing–providesasource-levelequivalentofreflectionmetadata.
Workingtogether,thesenewAPIsallowIDEsandothertoolstodigdeeplyintothestructuralinformationthatjavacextractsfromsourcecode.
Addi-tionally,javac'simplementationwasenhancedandtunedforembed-dedandinteractiveuse.
NetBeanswasheavilyupdatedtointegratewiththesenewcapa-bilities,enablingmanyimprovementsintheIDE(discussedbelow).
Thechangesalsopromisefuturebenefits:whenJavaSE7comesoutwithanewsetoflanguageenhancements,youshouldexpectNetBeans'toolsettocatchupveryfast.
AneweditorCommonsensesaysnoproductcanbeperfectineverythingitdoes,butNetBeansisgettingclosereachday.
Historically,Net-BeansusershavebeenproudoftheIDE'scompletecoverageofJavaplatformsfromMEtoEE,itssupportforeffectiveGUIbuilding,anditsintuitiveUIandopenarchitecture.
Ontheotherhand,theIDElaggedincertainareas,likeinthecodeeditororrefactoring.
Thiscouldputoffprogrammersveryfocusedinsourcecode…typeswho'llpickemacsovervisualdesignersanyday.
Well,theseprob-lemsarenomorewithNetBeans6.
0.
IssueThreeNjackpot.
netbeans.
orgTheJackpotproject.
www.
netbeans.
info/downloads/dev.
phpNetBeans6.
0developmentbuilds.
CoreIDENNetBeansMagazineAST-basedselectionSelectingwordsorlinesisgoodenoughfortexteditors,butwhenworkingwithsourcesyouoftenneedtoworkwithrangesoftextthatformcoherentpiecesofcode.
Sayyouwanttocopyallthecodeinsideaforloopbody1inordertopasteitinanotherloopwithsimilarlogic.
Justplacethecursorinanyblankpositioninsidetheloopbody,pressAlt+Shift+Upandyou'redone.
Theeditorselectstheinnermostrangeoftextthatincludesthecursorposition,anddelimitsanodeofthesource'sAbstractSyntaxTree.
TheJavacompiler(asdomostcompilers)parsessourcecodeintoanintermediaryrepresentation,whichisstructuredasatree.
Eachnodeinthisdatastructure(calledanAbstractSyntaxTree)representsacodeelement:aclass,method,statement,block,identifier,operator,literal,etc.
ThoughcodeprocessingtoolsusuallymanipulateprogramsasASTs,manyuseasimpleparserthatproducesonlyabasictree.
The"full"ASTproducedbyacompletecompilerlikejavac,whichiscapableofsemanticanalysisandcodegeneration,willcontainverydetailedandreliableinformationabouteachnode.
Forexample,thenodeforanidentifierholdsnotonlyitsnamebutalsoitstypeandits"definiteassignment"status(whethertheidentifierisguaranteedtobeinitializedatagivenpoint);itcanevenholditsstatically-calculatedvalue(whenapplicable).
ToolsthatworkontopofafullASTaremuchmorepowerfulandreliable.
Thedifferencewon'tbenoticeableforasimpleselectionfeature,butitmaybeverysignificantformoresophisticatedfunctionalitylikerefactorings.
EPressingAlt+Shift+Upagainexpandstheselectiontothenextouternode,inthiscasethecompleteforstatement;thenanewkey-strokemayselecttheentiremethod,andsoforth.
Alt+Shift+Downwillretracttheselectiontoaninnernode.
Figure1showsthisfeaturebeingusedtoselectamulti-linestatementeasilyandprecisely.
Ibetyouwillquicklybehookedonthisfeatureandforgetaboutalltheotherselectionshortcuts!
There'snothinglikeacodeeditorthatgrokscode,nottext.
SemantichighlighterTheeditor'ssyntaxhighlighterwaspro-motedtoasemantics-awarehighlighter.
Itcanapplystylesbasednotonlyonthetypesoftokens(likeidentifiers,operatorsorcomments),butalsobasedondifferentmeaningsthatakintokensmayhave–forinstance,anidentifiermaybeaclassnameoralocalvariablename,aparameter,aconstantfield,etc.
1Dependingonyourbracingstyle,thismaynotbeaseasyasselectingafewfulllines.
Therearemanyotherexamples,likeselectingacomplexexpressionthatspansmultiplelines.
Figure1Severalneweditorfeaturesinaction.
ASemantichighlighting(e.
g.
,identifyingusagesofgetImage(),andstaticvariablesinitalics)Keywordcompletionatamethod'sparameterlist.
Hierarchyview(openedonPaintCanvas)AST-basedselectionIssueThreeNNetBeans6.
0:NewCoreFeaturesinDepthOnebenefitofsemantichighlightingisthatithelpsyoutakeextracarewhenas-signingtostaticfields(sincemanythread-safetyandmemory-leakbugsinvolvestat-ics).
Figure1showsthisoff;noticethatstaticfields(andreferencestothese)ap-pearinitalics.
Thereareotherpowerfulusesforthenewhighlightingengine:Identifyingusages–Selectanyidenti-fier,andtheeditorhighlightsallitsusesinthesamecompilationunit.
Again,Figure1exemplifiesthis:clickingonamethodname,allinvocationstoitarehigh-lighted.
Flagging"Smellycode"–Theneweditorhighlightsunusedvariablesandimports,aswellasusageofdeprecatedclassesandmethods.
Youdon'tneedtoperformabuildorrunacodelinttooltodetectthesesim-ple(butfrequent)problemsanymore.
Exitandthrowpoints–Selectingamethod'sreturntypewillhighlightallreturnstatements.
Selectinganexceptioninthemethod'sthrowslistwillflagallthrow'softhatexceptiontype.
Allinvocationstoothermethodsthatmaythrowthesameexcep-tionarealsoflagged.
BettercodecompletionThebewilderingamountofAPIsyouhavetousethesedaysmakescodecompletiononeofthemostcriticalfeaturesofanymoderncodeeditor.
NetBeans6.
0haslearnedmanynewtrickshere:Keywordcompletion–Ifyou'vejusttypedapackagedeclarationinanewsourcefile(forexample),Alt+Spacewillbringonlythekeywordsthatarelegalinthatposition:abstract,class,enum,final,import,inter-faceandpublic.
Figure1showsanotherexample:aftertheopeningparenthesisofamethoddeclaration,thepreferredcompletionsareallprimitivetypes.
Type-basedvariablenames–Completingat"ConfigurationFile_",theeditorwillofferthevariablenamescf,configurationFileandfile.
(I'musing"_"torepresentthecursorposition.
)Generics-awarecompletions–Whenassigningavariablewithagenerictypetoanewexpression,theeditorwillofferallcompatibletypes,includinggenericarguments.
Forexample,at"Mapm=new_",codecompletionlistsallimplementationsofMap,eachwiththesameparameters.
Annotation-awarecompletions–Whencompletingafter"@",you'llbeofferedalltheannotationsthatcanbeusedinthegivenscope.
Andiftheselectedannotationrequiresparameterstheeditorwillprovidecompletionsforthesetoo.
Passingparameters–At"x=m(_",thetopcompletionswillbevaluesinscopethatarecompatiblewithm()'sfirstparameter.
Ifthemethod'sparameternamesareavailableandtherearevariableswithsimilarnamesinscope,thisisusedtosortthecompletionsfurther.
You'llalsobeofferedfullcompletionswiththeparameterlistfilledwiththosevariables.
Commonconstructors–Whenyouinvokecodecompletionwiththecursorpositionedbetweenclassmembers,you'llbeofferedtocreateaconstructorwithoutargumentsandonethatreceivesinitialvaluesforallfields(iftheseconstructorsdon'talreadyexist).
Catchingexceptions–Completionat"catch(_"willonlyofferex-ceptionsthatarethrowninthecorrespondingtryblock,buthaven'tbeenhandledyetbypreviouscatchblocks.
NewbrowsingviewsTheeditorintroducesseveralnewviewsforsourcecodebrowsing.
TheMembersviewshowsthemembersofaJavatypetogetherwiththeirjavadocs,makingiteasytofindaparticularmethod,fieldorinnerclass.
TheHierarchyviewshowstheinheritancetreeofaJavatype.
Figure1demonstratesthisview;noticethefilterbuttonsthatletyoutogglebetweensupertypesorsubtypesandbetweensimpleandfullyqualifiedclassnames.
Youcanalsochoosewhetherornottoshowinnerclassesandinterfaces.
TheDeclarationviewsummarizesthedeclarationoftheselectedJavaelement(type,methodorfield).
Despiteitsname,thisviewalsoshowstheinspectedelement'ssourcecodeifit'savailable.
TheDeclarationViewisespeciallyusefulwheninvokingcodestillunderCoreIDENNetBeansMagazine2Adevelopment,notyetdocumentedwithjavadoc.
Finally,theJavadocviewshowsthejavadocsfortheselectedJavaelement.
EditableDiffandInlineDiffTheeditor'simprovedarchitecturemakesiteasierforvariousfea-turesthathandlesourcecodetointegrateeditorfunctionality.
ThisisnoticeableinthenewDiff(opened,forexample,byselectingasourcefileandchoosingSubversion>Diff).
Whenit'sshowingalocalfile,therightpaneiseditable,providingthefullsetofeditorfeatures–seman-tichighlightingandcodecompletionincluded.
ThenewDiffaddsotherinterestingtricks,likeone-clickmergingandword-leveldiff(ifasinglewordischangedinaline,onlythatwordishighlighted).
CheckouttheseimprovementsinFigure2.
YoucanalsoenableanInlineDifffeature,whichcreatesaDiffside-bar,highlightingupdatedsectionsofaversionedfile.
Thesidebarletsyouvisualizeorrollbackchanges,andopenthefullDiffview.
JavadochintsYoualwaysdocumentallyourcode,rightWell,ifyoudon't,Net-Beanswillcomplainaboutmissingandincorrectjavadoctags.
TheIDEcanhelpyouwithautomaticfixesthataddthemissingtags,onlyaskingyoutofillintheblanks.
Andwhileyou'redoingthat,youcanusethenewJavadocviewforconvenientpreviewing.
Javadoccheckingisactivebydefault,butit'snotintrusive:theedi-torwillreportmissingjavadoctagsjustfortheselectedline;onlyincorrecttagswillbereportedeverywhere.
YoucancustomizetheseandrelatedoptionsthroughTools|Options>JavaCode>Hints.
OtherfeaturesTheneweditoranditsframeworkincludeothergeneralfeatures,likereusableeditortabs.
Theseareusefulforthedebugger,toavoidclutteringyourenvi-ronmentwitheditorsopenedbybreakpointsorstep-into's.
There'salsoanewGenerateCodedialogthatautomatesthecreationofconstructors,gettersandsetters,equals()andhashCode(),anddelegatemethods.
RefactoringandJackpotNetBeans6.
0improvestheexistingrefac-toringsupportextensively.
Thereisanewinternallanguage-independentrefactoringAPIthatwillallowimplementingrefactoringsforcodeotherthancommon.
javasources(e.
g.
,XMLorJSFfiles).
ThenewAPIalsoallowsJavarefactoringstopreciselyupdatedependentnon-Javaelements.
Thisshouldmakethecurrentrefactoringssaferandeasiertouse.
Thebignewshere,though,isthebreak-throughnewtechnologyfromprojectJack-pot,whichhasbeenavailableforsometimebutisonlyreachingmaturitynow.
WithitsinclusioninNetBeans6.
0,JackpotwillbepromotedtoastandardfeatureandbemorecloselyintegratedwiththeIDE.
YoumayhaveheardthatJackpotisanewrefactoringtool,butthisreallydoesn'tmakeitjustice.
Jackpotisactu-allyacomprehensiveframeworkforgen-eralcodeunderstandingandmanipula-tion.
Youcanuseitasareplacementorfoundationforseveralkindsoffeatures:refactoringsupport,advancedsearchingandbrowsing,qualityinspection,macro-likeautomationofcomplexeditingtasks,andmore.
UsingJackpotBeforetakingamorein-depthlookatJack-pot,let'sshowhoweasyitistouse.
ThenewFigure2TheLocalHistoryandthenewDiff:editingcapability,semantichighlightingandword-leveldiff.
AIssueThreeNNetBeans6.
0:NewCoreFeaturesinDepth4A3AQueryandRefactorcommandwillshowadialoglikeFigure3,whereyoucanpickaJackpotqueryorqueryset.
Somequerieshaveoptionsthatyoucansettopreferredvalues.
ClickQuery,andanymatchesfortheselectedquerieswillappearinaviewthatdetailseachmatch.
Also,ifthequeryinvolvescodechanges,youcanpreviewandconfirmthesechangesbyclickingonaDoRefactoringbutton.
JackpotrulesJackpot'sfullpowercomesfromitsopen-ness.
ThisrequireslearninganewlanguagebutwhenyourealizeJackpot'sfullpotentialyouwillseethatthelearningcurvequicklypaysoff.
Forexample,hereisaJackpotquerythatdetectsaninefficientcodepattern–theuseofequals("")tocheckifaStringisempty–andrewritesthematchingcode:$s.
equals(s.
length()==0)::$sinstanceofjava.
lang.
String;Thesyntaxispattern=>replacement::condition,wherethe$characteridentifiesmeta-variablesthatwillbindtoanyJavaprogramelement(identifier,statement,operator,literal,etc.
).
Let'sanalyzeeachclause:1.
Thepattern$s.
equals("")matchesinvocationstotheequals()methodthatpassanemptystringasargument.
2.
TheconditionistheonlyoptionalpartofaruleinJackpot'srulelanguage,butit'sacriticalpartinthisparticularrule:$sinstanceofjava.
lang.
Stringmakessurethattheruleonlyfireswhen$sisaString.
That'sanimportantconstraint,sinceourruleisspe-cifictousesofjava.
lang.
String.
equals(),andnottojustanyimplementationofequals().
3.
Finally,thereplacement–($s.
length()==0)–re-writesthematchingcode.
There'salotofsophisticationbehindthisapparentlysimplebehavior.
Foronething,lookatJackpot'sinstanceofoperator.
ItwalksandquackslikeJava'sinstanceof,butit'snotthesamething.
Java'sinstanceofisaruntimeoperatorwhoseleft-handoperandisanobjectreference.
Jackpot'sinstanceof,however,isacom-pile-time(static)operator;itsleft-handoperandisanynodeoftheprogram'sAST.
BecauseJackpot–liketheneweditor–reliesonjavac'ssourceanalysisengine,it'sabletofullyattributealltypesintheprocessedcode.
Thisincludesthemostcomplexcases,likeinferredgenerictypes.
Othercodeanalysistoolsoftenresorttoheuristicsthatapproximatetypesbutmightfailtocalculatetypesforsomeex-pressions.
Youcouldeventrytodoourrefactoring(replacings.
equals("")bys.
length()==0)usingplainregularexpressions:searchfor(\w*)\.
equals\andreplaceitwith$1.
length()==0.
Butregexesarerigidanddumb;theywon'tEFigure3Jackpot'sQueryandRefactordialog.
AFigure4Jackpot'sRefactoringManager.
ACoreIDE10NNetBeansMagazineevenexcludetextthat'sinsidecommentsorstringliterals,andasimplelinebreakwillpreventdetection.
Thisisobviouslyastrawmanexample(othertools,likePMDandFindBugs,aremuchsmarterthanregexes–althoughnotuptojavac-likeprecision),butitshowsthevalueofsmartertools/features.
ThereareJackpotoperatorswithoutJavacounterparts,fromsimpleoneslikeisTrue(node),whichmatchesbooleanexpressionsthatcanstaticallybeproventoalwaysevaluatetotrue–tomorepowerfuloperatorslikeisSideEffectFree(node).
Thelattermatchesastatement,blockormethodthatdoesn'tmodifyanyvariableout-sideitsscope.
Again,suchdetectionsresembleexistingcodeinspectiontools,whichdetectproblemslike"deadcode".
ButJackpot'srelianceonthefulljavactechnologyresultsinfewerfalsepositivesindetec-tions,andhighersafetyinautomaticreplacements.
YoucanalsowriteJackpotqueriesinplainJava,usingJackpotAPIsandNetBeans'moduledevelopmentfeatures.
ThisisnecessaryforcomplexrulesthatgobeyondthecapabilitiesofJackpot'srulelanguage.
Butasthislanguageevolves,fewerandfewerqueriesshouldrequireimplementationinJava.
Performance,bytheway,isnotanissue:querieswrittenintheJackpotrulelanguageareconvertedtoJavaandexecuteascompiledcode.
Figure4showsJackpot'sRefactoringManager.
Thisconfigura-tiondialogallowsyoutoinspectallinstalledqueriesandorganizethemintoquerysets.
Youcanalsoimportnewqueries.
Ifyouwriteanewqueryscript,justclickImportandthenewquerywillbeavail-ableintheQueryandRefactordialog.
UsageandperspectivesJackpotshipswithalibraryofpredefinedqueries,containingmanyrulesforcodeclean-upanddetectionofcommonprogrammingmis-takesorcodeanti-patterns,aswellasmigrationofdeprecatedAPIusage.
AsIwritethis,JackpothasjustbeenintegratedintoNetBeans.
SowehaveahybridsystemwithJackpotco-existingwithtraditionalrefactoringandcodemanipulationfeatures.
Thismeansthatcom-mandslikeRenamemethodarestillimplementedintheold-fashionedway,eventhoughtheycouldbeimplementedbyaJackpotrule.
Thesameholdsforcodevalidations("hints")andtheirautomaticfixes.
Someofthisfunctionalitywillcertainlybere-E5AimplementedonJackpotinthefuture.
Also,becauseJackpotmakesthedevelopmentofsuchthingsmucheasier,youshouldexpectanincreasingnumberofrefactorings,vali-dationsandothercode-crunchingfeaturestobeaddedtotheIDE.
ExtendedAntandJUnitsupportAntsupportinNetBeans6.
0hasbeenup-datedtoAnt1.
7.
0,amajornewreleasethataddssuchfeaturesassupportforJSR223-compatiblescriptinglanguages.
There'salsoanewprogressindicatorforAntpro-cesses.
TheIDE'sJUnitsupportnowhandlestheannotation-driventestcasesofJUnit4.
OldJUnit3.
8testcasesarestillsupported.
Also,theprojectpropertieseditorisim-provedwithclasspathentriesspecifictounittests.
ProjectandbuildfeaturesEditingcodeisfundamental,butformostnon-trivialprojectsawell-structuredandpowerfulbuildsystemiscriticaltoo.
NetBeans'projectmanagementandbuildsystemwasimprovedwithmanynewfea-tures.
InadditiontoitsAntsupport,NetBeanscanopenandunderstandApacheMaven2projects.
ThoughthenewMaven-basedproj-Figure5MultipleConfigurationsandsupportforJavaWebStartinthenewProjectPropertiesdialog'sRunpage.
AIssueThreeN11NetBeans6.
0:NewCoreFeaturesinDepthectsupportisnotintendedtoreplaceAntprojectsanytimesoon,itwillbewelcometoMavenfansortoanybodyneedingtobuildaprojectthatrequiresMaven.
Also,nowyoucanspecifypackagesorclassestoexcludefromthesourcetree.
Thisisusefulforworkingwithlargeproj-ects,whenyou'renotinterestedinseeingorrunningalloftheircodeandapartialbuildisviable.
Ifyouhavemanycorrelatedprojects,youcanorganizethemintoProjectGroups,socertainoperationslikeopeningprojectscanbeappliedtothegroupasawhole.
AndifyouwriteJavaSEprojectswithmanyentrypoints(classeswithmain()methods),orwithcommand-lineparametersthatre-quirefrequenteditsoftheprojectproper-ties,theRunConfigurationsfeaturewillmakeyourlifeeasier.
Theprojectproper-ties'RunpageshowsanewConfigurationoption.
Eachconfigurationallowsyoutodefinethemainclass,argumentsandVMoptions,independentlyofotherconfigura-tions.
SeeanexampleinFigure5.
Furthermore,thenewJavaWebStartsup-portautomatesthecreationandmainte-nanceofJNLPfiles,andmakesiteasiertoruntestswithoutneedingabrowser.
IntheProjectProperties,checkApplication>WebStart>EnableWebStart,andoffyougo.
JavaWebStartsupportintegrateswiththeRunConfigurationsfeature,bycreatingaWebStartconfiguration.
SoyoucantestthesameprojectwithorwithoutJAWS.
VersioncontrolRobustversioncontrolisanessentialfea-ture,evenforsimpleprojectswrittenbyonedeveloperoveraweekend.
Foronething,it'scriticaltoenable"fearlessprogram-ming",e.
g.
usingtechniqueslikerefactoring(manualorautomatic)withoutworry.
NetBeans6.
0bringsplentyofnewsinthisareatoo.
CVSNetBeanshastraditionallysupportedtheCVSversioncontrolsys-temandthissupportwasalreadyexcellentinNetBeans5.
5.
Version6.
0addsseveralupdatesinusability,likeexportingadiffpatchoffilesselectedintheSearchview;anewcommandtoopenaspecificrevision,tagorbranch;andanimprovedhistorysearchfeaturewithnewSummaryandDiffviews.
Therearealsonewadvancedopera-tionslikechangingtheCVSrootanddoingapartialmerge.
SubversionThebiggestnewsformanyusers,though,issupportforthein-creasinglypopularSubversionversioncontrolsystem.
NetBeans6.
0isthefirstreleasetointegratecompletefirst-classsupportforSVN.
EventhoughNetBeans5.
5nowoffersaSubversionmoduleintheUpdateCenter,youreallywantversion6.
0ifyouareaheavySubversionuser.
LocalHistoryNomatterwhichVersionControlSystemyouprefer,you'lllovethenewLocalHistoryfeature,alreadydepictedinFigure2.
NetBeans6.
0automaticallykeepsaninternalhistoryofrecentchangestoprojectresources.
Everytimeyousaveafile,thisisregisteredasa"commit"ofanewversionofthefileinthelocalhistory.
Sofilechangesaretrackedwithfinegranularity–somewhatlikeapersis-tentundofeature.
Youcaninspectthe"versions"inthelocalhistoryanddiffthemagainstthecurrentfiles.
Bewarned,however,thatthisfeatureismostlyusefulforundoingmistakesthatescapetheeditor'sundocapacity,e.
g.
afterclosingtheeditororrestartingtheIDE.
Youcanthenreverttoapreviousstatethatyouhaven'tyetcommittedtoasaferVCSrepository,per-hapsbecausethenewcodewasstillroughanduntested.
TheLocalHistoryfeatureispowerfulandissometimesalifesaver,butit'snotafullreplacementforarealVCS.
DebuggingThedebuggerisofcourseamongthemostcriticalfeaturesofanIDE,andNetBeansisalreadyverycompleteinthisarea.
Sowhat'slefttoimprovein6.
0Firstoff,theJavaSE6releasecontainstwonbi.
netbeans.
orgThenewNetBeansInstaller.
Asofthiswriting,youmustfollowalinktoadirectorywhereyou'llnavigatetotheinstallerpageforaspecificbuildCoreIDE12NNetBeansMagazineimportantnewJVMdebuggingfeatureswhichrequireanupdatedde-buggertouse.
(ThedebuggersfromNetBeans5.
5orolderreleaseswon'tbenefitfromtheseevenifyourunthemontopofJavaSE6.
)TherearealsootherdebuggerimprovementsthatarenotdependentontheJREversion,soyou'llbenefitevenifyouarechainedtosomestone-ageJavaruntimelike5.
0or,heavensforbid,1.
4.
2.
ForcingreturnvaluesSupposeyou'resteppinganywhereinamethodandyou'dliketoforceittoreturnimmediatelyandproduceaspecificreturnvalue.
Thisisnowsupportedinthe6.
0debugger,lettingyoucheck"what-if"scenariosandreproducebugsmoreeasily.
Youwon'tneedhackslikepatchingthesourcecodewithreturnstatements(andhavingtounpatchitlater).
AsIwrite,thisfeatureisnotyetimplemented,butitshouldbebeforethefinalrelease.
ExpressionsteppingExpressionsteppingisanothersmarttimesaver.
Incomplexexpres-sionscontainingmethodcalls,youcanstepintoindividualinvoca-tions,andwhensuchacallreturnsyoucanseethereturnedvalueevenit'snotassignedtoanylocalvariable.
Younolongerhavetobreakexpressionsintosimplepartsandintroducetemporarylocalsforthesinglepurposeofhelpingdebugging.
Also,theLocalVariablesviewwillshowthevaluereturnedbyinvokedmethods.
ExpressionsteppingwillworkinanyJavaruntime,butshowingval-uesreturnedbyinvokedmethodsrequiresJavaSE6.
MultithreadingsupportAnothernewfeaturethat'sveryusefulisDebugcurrentthread:youcaninstructthedebuggersothatonlyagiventhreadwillstopinbreakpoints.
Thisiscrucialfordebuggingconcurrentapplicationsthathaveseveralthreadsrunningthecodeofinterest.
Sincewedevelopersarenotmultithreaded,we'reeas-ilyoverwhelmedwhensettingabreakpointcausesthedebuggertostoptwentythreadsatonce!
OtherfeaturesTherearealsogeneralimprovementstootherfeatures,likebetterhandlingofbrokenbreakpoints(e.
g.
withincor-rectconditions),andacommandtocopycallstackstotheclipboard.
6ANewProfilerfeaturesInNetBeans6.
0,theProfilerbecomespartofthecoredistribution,andthere'sarangeofimportantimprovements.
Betterperformance–Performanceisgoodanywherebutit'salwaysacriticalis-sueinprofilers.
TheNetBeansProfiler,whichderivesfromSun'sJFluidresearchproject,pioneeredanewtechnologythatallowspro-filingappsnearlyatfullspeedbydynami-callyinstrumentingcode.
Also,theProfileritselfshouldbefasttoanalyzeandpresentdatacollectedfromtheJVM–especiallyonlinedatathat'sconstantlyupdatedastheprogramruns.
ThenewreleaseimprovessignificantlytheperformanceoftheLiveRe-sultscategorizationanddrilldown,soyou'llfindyourselfusingthisfeaturemoreoften.
Classloadingtelemetry–TheVMTe-lemetryviewnowshowsthenumberofloadedclassestogetherwiththenumberofthreads.
Memorysnapshotcomparison–Yourapplicationhasamethodthat'ssuspectofleakingTakeheapsnapshotsbeforeandaf-terrunningitthendiffthetwosnapshots.
HeapWalker–Theultimatetoolforleakhuntingandanykindofmemoryallocationanalysis.
Youcanloadaheapdumpandvi-sualizethefullobjectgraphintheheap(seeFigure6).
Figure6TheProfiler'sHeapWalker,inspectingaparticularinstanceofBigInteger.
AIssueThreeN13NetBeans6.
0:NewCoreFeaturesinDepth2Incidentally,severalmenuoptionsweresim-plifiedinNetBeans6.
0;forinstance,JavaPlat-formManagerbecameJavaPlatforms.
Loadgeneration–TheProfilersupportsintegrationwithloadgenerationtools(cur-rentlyonlyApacheJMeterissupportedbutmoreistocome).
ProfilingPoints–Theseareaprofiler'sequivalentofdebuggerbreakpoints.
Youcandefineplacesinyoursourcecodewheretheprofilershouldstart/stoptheclock,resetprofilingresultsortakeasnap-shot.
TheProfilingPointsfeatureremovesmostbureaucraticprofilingwork:neveragainwillyouneedtosteporpausecodetogetsnapshotsincriticalevents;youalsowon'tneedtotweakcodetomeasurethelatencyofaregionthatdoesn'tcoincidewithafullmethod.
GUIandusabilityAnIDEshouldhaveabeautiful,efficientandproductiveGUIasmuchasanyotherapplication.
NetBeans6.
0makesnewstridesinthisdirection.
LinuxandSolarisuserswillcertainlywel-comethemuchimprovedGTKL&F,whichisnowactivatedbydefaultontheseplat-forms.
Theactivated-by-defaultpartde-pendsonSun'sJRE6Update1(orbetter),whichcontainsitsownshareofimportantGTKupdates.
NetBeanswillrespectallsettingsfromtheactiveGTKtheme.
ThenewNetBeansInstaller(NBI)makesinstallationeasierandfaster.
Inthedown-loadspage,youcanselectwhichpacksyouwant(e.
g.
Enterprise,Mobility).
Thenyou'llbeofferedacustominstallerthatincludesallchosenfeaturesandwillin-stalltheseinasinglego.
NBIisespeciallyconvenientforsystemadministratorsthatneedtoinstallthesameIDEconfigurationinmultiplemachines,andfortrainerswhooftenlandinunpreparedlaboratories.
NetBeansalsoincludesredesignedicons,andtheSDIwindow-ingoption(arelicfromancientNetBeansreleases)wasremoved.
Nowyouhaveundockable/floatingwindows.
Finally,intheQAfront,thenewReportExceptiontoolstreamlinesreportingofdetaileder-rordatatoNetBeans'developers,whiletheUIGesturesCollectorcansubmitdataaboutyourIDEusagepatterns.
Thisdataisusefulnotonlyforresearch,butalsotoimplementakindof"tipoftheday"hintsystemnotbasedonMath.
random().
Itestedthis,andtheNetBeansAnalyticssiteofferedmeatutorialaboutprofilingmultithreadedprograms,whichwashighlycorrelatedwiththetasksIhadbeenperforminginrecentdays.
MatisseandvisualwebdevelopmentThereareonlytwocoreIDEfeaturesI'mnotcoveringhere.
Bothareaward-winningtoolsandtopreasonsformanydevelopershav-ingmovedtoNetBeans:theMatissevisualeditor,andtheVisualWebPack.
NetBeans6.
0bringssignificantupdatestoboth.
ForMatisse,checkoutthearticle"UIDesigninNetBeans6.
0"inthisissue,whereyou'llfinddetailedinformationaboutwhat'snew.
Currently,themostimportantchangesintheVisualWebPackrefertoitsintegrationintotheNetBeanscore.
Actually,therewon'tbeanexternalWebPackfor6.
0.
TheIDEalreadyofferedsupportforwebapplicationdevelopment,soitwasalittleoddtohavesomeofthatinthecoreandtherestinanexternalPack.
Historically,thishappenedbecausetheWebPacktechnologywasoriginallydevel-opedasaseparateproduct(Sun'sJavaStudioCreator),whichwasbasedonaforkofaveryoldNetBeansversion.
Soitsimplementa-tionbecamepartiallyredundantwithNetBeans'webtooling.
Nowthischasmisclosedandtherewillbenomoreduplicatecodeoreffort.
ThemergeresultsinasimplerIDEforallusers:fromvisual-designloverstotag-writingdiehards.
Thereareseveralnewfeaturesintheintegratedwebtoolingbutaswewritetheyarestillunderheavydevelopment,soitwasn'tviabletocoverthenewfunctionalityinthisissue.
However,don'tmissthearticle"VisualWebApplicationDesignwithNetBeans"foranupdatedtutorialonthelaststableversion.
PluginManagerNetBeans'open,extensiblearchitectureisoneofitscoreadvan-tagesandit'salsoveryeasytouseandintegratewith.
YoumaybesurprisedthattheTools>UpdateManagerhasdisappeared,though.
CoreIDE14NNetBeansMagazine7AButjustlookagain,atTools>Plugins2,andyou'llseeFigure7.
ThenewUIunifiesandbetterorganizestheoldUpdateCenter(seetheUpdates,NewPlugins,DownloadedandSettingstabs),andalsotheoldmodulemanager(seetheInstalledtab).
Therearenewfea-turestoo:forexample,whenyouselectaplugin(likewedidfortheJMeterModuleinFigure7),aRequiredPluginsnodewillappearifapplicable;youcanexpandittoseeanydependenciesthatmustalsobeinstalled.
ConclusionsNetBeans6.
0comeswithamassivenumberofnewandimprovedfeaturesandcertainlydeservesthemajorversionbump.
IfNetBeans5.
5waswide,NetBeans6.
0isalsodeep.
Developersupgradingtothelat-estversionwillhavenotonlyextensivesupportforallkindsofJavadevelop-mentbutalsoabest-of-breedfeaturesetineveryimportantfunctionalityarea.
ManyNetBeanspowerusersmayhavegonethroughthisarticleandfoundfea-turesthatwerealreadyavailableforpre-viousversionsviaadditionalmodules.
FromseveraleditorenhancementstoRunConfigurations,totheLocalHistory,youcouldfindannbmfilethatwouldprovidesomelevelofsupportforyourneed.
However,youcannowjustinstallthecoreIDEandhaveallthesefeaturesoutofthebox–andthey'resuperior,morepolishedandbetterintegratedthanwhat'sprovidedthroughexternalmodules.
Thishappensofcoursewitheverynewrelease,butNetBeans6.
0makesaverynoticeableefforttocatchupwithitsRFEs,embracingalargenumberofimprovementsthatfirstsurfacedascontributionsfromthebroadercommunity.
Thiscanonlybeviewedasgreatnews,andasevidenceofaprojectthatmovesfastinthedirectionus-erswant.
COsvaldoPinaliDoederlein(opinali@gmail.
com)isasoftwareengineerandconsultant,workingwithJavasince1.
0beta.
He'sanindependentexpertfortheJCP,havingservedforJSR-175(JavaSE5),andisaTechnologyArchitectatVisionnaireInformatica.
OsvaldohasanMScinObjectOrientedSoftwareEngineering,isacontributingeditorforJavaMagazineandmaintainsablogatweblogs.
java.
net/blog/opinali.
Figure7ThenewPluginManager.
ACoreIDEWiththisthirdissue,NetBeansMagazineiscompletingitsfirstanniversary.
KudosandthankstotheNetBeansdevelopercommunityforenablingustospreadthewordevenmoreaboutthiswonderfulIDEandPlatform!
1Yearnetbeans.
org/community/magazinemagazineCoreNetBeans6.
0FeaturesKnowindepthwhat'scominginthenewreleaseIntroducingC/C++PackLeverageNetBeansfornativedevelopmentTheblueMarineProjectNetBeansPlatformdevelopmentintherealworldOpenOffice.
orgIntegrationCreateadd-onsandcomponentstointerfacewithOOoProjectSchliemannOpeningtheIDEtootherlanguagesMobilityPackinPracticeLearnthebasicsandreducedevicefragmentationNewUIDesignFeaturesUpgradeyourdesktopproductivitywithNetBeans6.
0VisualWebDevelopmentRapidwebapplicationdesignandimplementationMay.
2007Release6.
0.
JSF.
Matisse.
C/C++.
Mobility.
NetBeansPlatform.
ScriptingLanguagesmagazineReachOutwiththeIDEandPlatform
RAKsmart机房将于7月1日~7月31日推出“年中大促”活动,多重惊喜供您选择;爆款I3-2120仅30美金秒杀、V4新品上市,活动期间5折抢购、爆款产品持续热卖、洛杉矶+硅谷+香港+日本站群恢复销售、G口不限流量产品超低价热卖。美国VPS、日本VPS及香港VPS享全场7折优惠;爆款VPS $ 1.99/月限量秒杀,10台/天,售完即止, VPS 7折优惠码:VPS-TP-disRAKsmar...
之前几个月由于CHIA挖矿导致全球固态硬盘的价格疯涨,如今硬盘挖矿基本上已死,硬盘的价格基本上恢复到常规价位,所以,pacificrack决定对全系Cloud server进行价格调整,降幅较大,“如果您是老用户,请通过续费管理或升级套餐,获取同步到最新的定价”。官方网站:https://pacificrack.com支持PayPal、支付宝等方式付款VPS特征:基于KVM虚拟,纯SSD raid...
最近我们是不是在讨论较多的是关于K12教育的问题,培训机构由于资本的介入确实让家长更为焦虑,对于这样的整改我们还是很支持的。实际上,在云服务器市场中,我们也看到内卷和资本的力量,各大云服务商竞争也是相当激烈,更不用说个人和小公司服务商日子确实不好过。今天有看到UCloud发布的夏季促销活动,直接提前和双十一保价挂钩。这就是说,人家直接在暑假的时候就上线双十一的活动。早年的双十一活动会提前一周到十天...
highlighter为你推荐
小企业如何做品牌小公司如何创立自己的品牌苹果appstore宕机apple id登陆不了app store怎么办重庆网站制作请问一下重庆网站建设哪家公司做得好,价格又便宜哦?温州都市报招聘在温州哪里好找工作?美国独立美国独立的意义团购程序团购系统软件有哪些?一般需要考虑那几点?网店系统哪个公司开发商城系统比较好?推荐位关于橱窗推荐位规则的描述哪个是错误的无忧登陆器无忧登陆器加载数据异常.无法登陆站内搜索什么是站内搜索?
网站空间域名 浙江vps 美国主机排名 linode代购 2017年万圣节 论坛空间 中国电信测网速 33456 服务器监测 国外视频网站有哪些 网络速度 rewritecond 万网服务器 贵州电信 新网dns godaddy退款 阿里云宕机故障 卡巴斯基免费版下载 以下 神棍节 更多