At the conclusion of a jury-waived trial, a judge of the District Court found the defendant guilty of carrying a firearm without a license, G. L. c. 269, § 10(a); possession of a firearm without a firearm identification card (FID card), G. L. *297c. 269, § 10(h)(1); and drinking alcohol in public, in violation of a Brockton city ordinance.1
The defendant appeals from his convictions of the two firearms-related offenses upon the grounds (1) that the patfrisk search of his person uncovering the unauthorized firearm lacked justification; and (2) that the convictions violated his right to keep and bear arms under the Second Amendment to the United States Constitution, as applied through the due process clause of the Fourteenth Amendment. For the following reasons, we affirm the judgments.2
Facts. Two officers testified at the pretrial suppression hearing, State police Troopers Michael McCarthy and Carlton Jackson. The evidence developed at the hearing permitted the motion judge to find as follows.
At approximately 9:45 p.m. on June 19, 2009, McCarthy, Jackson, and a Brockton police officer were patrolling an area of Brockton in an unmarked cruiser. The area had a history of firearm offenses, narcotics violations, and homicide. The officers spotted the defendant as he walked unsteadily in the street and drank from an apparent bottle wrapped in a brown paper bag. They pulled over and approached him on foot. From close range they saw more clearly the neck of a green bottle and smelled the aroma of alcohol. The defendant acknowledged that he was drinking beer. When the officers removed the brown bag, they found a forty-ounce bottle of beer.
Trooper Jackson asked the defendant whether he possessed any objects which might harm, poke, or prick the officer.3 He *298did so because he was intending to patfrisk the defendant. The defendant answered “Yeah” or “Yes.” Jackson proceeded with the patfrisk. He felt a handgun in the front right pocket of the defendant’s jacket. In the continuation of the patfrisk he found a round of ammunition in one of the rear pockets and some marijuana in another pocket. The defendant admitted that he did not have a license for the handgun. The officers acknowledged that they typically had not arrested individuals in Brockton for public consumption of alcohol and that they did not have the intention to arrest the defendant at the beginning of their encounter.
At the conclusion of the suppression hearing, defendant’s counsel argued vigorously that the police had lacked cause for the pat-frisk because they had no reasonably based concern for their safety. Counsel relied specifically upon the reasoning of Commonwealth v. Gomes, 453 Mass. 506, 510-514 (2009) (Games), an instance in which police observation supported reasonable suspicion of the defendant’s conduct of a drug sale but not reasonable grounds for concern for their safety as they confronted the participants in the transaction.
The judge denied the defendant’s motion to suppress. She reasoned that “[ojnce it was determined defendant was drinking in public and smelled of alcohol, defendant was subject to arrest and given his condition possible protective custody.” At this point the troopers were justified in conducting a patfrisk for officer safety prior to taking defendant into custody. As a material distinction, she observed that in the Gomes case, ibid., the patfrisk had preceded the discovery of evidence creating the charges, but that in this instance criminal conduct and ground for arrest had preceded the patfrisk.
Analysis. 1. Validity of the patfrisk. Under the usual standard of review we defer to the motion judge’s subsidiary findings, unless they show clear error. See, e.g., Commonwealth v. Scott, 440 Mass. 642, 646 (2004); Commonwealth v. Washington, 449 Mass. 476, 480 (2007). The reviewing court makes an independent determination of the correctness of the judge’s application of the constitutional standards to the findings. See, e.g., Commonwealth v. Mercado, 422 Mass. 367, 369 (1996); *299Commonwealth v. Bostock, 450 Mass. 616, 619 (2008). The Commonwealth carries the burden of proof that a stop and pat-frisk proceeded within constitutional limits. Gomes, supra at 509, citing Commonwealth v. DePeiza, 449 Mass. 367, 369 (2007). The reviewing court may affirm a motion judge’s suppression order upon grounds different from those employed by the judge so long as the record furnishes support for the affirmance. See Commonwealth v. Va Meng Joe, 425 Mass. 99, 102 (1997); Commonwealth v. Cruz, 430 Mass. 838, 844 (2000).
Our case presents somewhat unusual circumstances. In the course of their street encounter with the defendant, the police had probable cause to arrest him but as a matter of discretion were not intending to do so. As a matter of practice, they were intending to pat frisk him without a specific subjective concern about a threat to their safety.
a. Objective justification.4 Under both the standards of the Fourth Amendment to the United States Constitution and art. 14 of the Declaration of Rights of the Massachusetts Constitution, it is settled that the test for authorization of a seizure or search by the police is objective reasonableness in the eyes of a detached and perceptive observer. “The subjective intentions of police are irrelevant so long as their actions were objectively reasonable.” Commonwealth v. Cruz, 459 Mass. 459, 462 n.7 (2011). See Whren v. United States, 517 U.S. 806, 812-813 (1996); Commonwealth v. Santana, 420 Mass. 205, 207-209 (1995); Commonwealth v. Smigliano, 427 Mass. 490, 493 (1998); and Commonwealth v. Daniel, 81 Mass. App. Ct. 306, 315 n.14, further appellate review granted, 462 Mass. 1101 (2012). In this instance, the evidence established that the police stopped the defendant with reasonable suspicion of the offense of public consumption of alcohol but without subjective intent to arrest him and without subjective fear for their own safety. However, once the defendant admitted that he was carrying an object potentially harmful to the inquiring officer, the defendant cre*300ated an objective basis for the ensuing patfrisk. The objective basis received reinforcement from several other circumstances: the encounter occurred in a vicinity with a history of firearms violations; the defendant was unfamiliar to the officers; and he was intoxicated so that his conduct was unpredictable.
b. Gomes comparison. The material facts of the Gomes case are distinguishable from our circumstances. In Gomes, the police had reasonable suspicion to stop the defendant and inquire about an apparent drug sale. 453 Mass. at 511-512. They were patrolling a “high crime area” in which drug transactions were common. Id. at 511. They were familiar with the defendant as a suspected “impact player” in Boston drug trafficking. Id. at 508. The essential reasoning of Gomes is that, while the officers had reasonable suspicion for the stop, they lacked objective grounds for the belief that Gomes posed a threat to their safety. Id. at 512-513. Consequently the immediate patfrisk of Gomes was constitutionally impermissible. Id. at 512-514.
The critical distinction between the circumstances of Gomes and those of this case is the interrogation of the suspect by police between the stop and the frisk. In Gomes, the police proceeded immediately to the frisk.5 Here they paused to ask a material question: whether the suspect was carrying any harmful objects. The positive answer furnished an objective justification for the ensuing patfrisk.6
*3012. Second Amendment right to keep and bear arms. On appeal the defendant has introduced the contention that the requirements of a firearm license by G. L. c. 269, § 10(a), and of an FID card by G. L. c. 269, § 10(h)(1), unconstitutionally limit his Second Amendment right to possess a firearm as confirmed by the decisions of District of Columbia v. Heller, 554 U.S. 570, 626-627 (2008) (Heller), and McDonald v. Chicago, 130 S. Ct. 3020, 3050 (2010) (McDonald).* *****7 In Commonwealth v. Powell, 459 Mass. 572, 584-589 (2011), cert. denied, 132 S. Ct. 1739 (2012) (Powell), the court interpreted the Heller and McDonald decisions to invalidate legislation categorically prohibiting possession of a firearm in an individual’s home but not to prohibit legislation reasonably regulating possession and use of firearms as an exercise of the police power to serve the public health, safety, and welfare.
In order to challenge the Massachusetts licensure statute as an invalid or unreasonable regulation, a defendant must earn standing by application for, and denial of, licensure. See Powell, supra at 590; Commonwealth v. Loadholt, 460 Mass. 723, 725 (2011). That requirement also would govern the FID card offense. The defendant does not claim that he applied for either.8
Finally, the defendant has argued for the first time on appeal *302that the lack of a license or of an FID card should constitute a prima facie element of the statutory offenses and that the burden of proof beyond a reasonable doubt of those negative elements should fall upon the Commonwealth. In Powell, supra at 582, the court maintained the rule that the absence of a license is not an element of the crime and that possession of a license is an affirmative defense to be proved by the defendant. Accord Commonwealth v. Eberhart, 461 Mass. 809, 813-814 (2012); Commonwealth v. Gouse, 461 Mass. 787, 802-808 (2012). We add that, in this case, the defendant’s failure to apply for licensure or for the FID card did not constitute a disputed fact at trial. The allocation of pleading and proof played no part in his convictions.
Judgments affirmed.
The ordinance provides, “No person shall, on any public way,. . . whether in or upon a vehicle or on foot, drink or have in [his] possession an opened container of any alcoholic beverage . . . .” Revised Ordinances of the City of Brockton § 14-12(a) (1988). General Laws c. 272, § 59, as amended by St. 1981, c. 629, states in relevant part, “whoever is in a street or elsewhere in a town in wilful violation of an ordinance . . . the substance of which is the [regulation of] drinking or possession of [an] alcoholic beverage . . . may be arrested without a warrant by an officer authorized to serve criminal process . . . and kept in custody until he can be taken before a court having jurisdiction of the offence.”
The judge placed the conviction of public consumption of alcohol on file. In the absence of a formal sentence, that disposition lacked the finality of a judgment necessary for appeal. See Commonwealth v. Delgado, 367 Mass. 432, 437-438 (1975), and cases cited.
Trooper Jackson testified that he had asked the question whether the *298defendant had “anything that could poke, prick or harm me.” Trooper McCarthy testified that he heard the question.
The defendant challenges the reasoning of the motion judge upon two grounds. He first argues that if one were to interpret the judge’s reasoning to be that the patfrisk constituted a search incident to a lawful arrest, the predicate lawful arrest had not occurred at the moment of the patfrisk. Second, he reasons that, if the justification for the patfrisk was a concern for officer safety, neither officer testified that he felt such a concern.
Id. at 508. Three officers confronted Gomes.
“Officer Walsh observed the defendant and [a second individual] engaging in what appeared to be a drug transaction. The defendant was standing in the doorway with his right hand opened flat as if displaying some object or items to [the individual], which Officer Walsh could not see. The police cruisers stopped, the officers left their vehicles, and they started to approach the defendant. As they did so, Officer Walsh saw the defendant put his right hand up to his mouth and appear to swallow something. Officer Walsh asked the defendant what he was doing there, and he immediately conducted a patfrisk for weapons. While the defendant was being patted down, a clear plastic bag containing five individually packaged rocks of ‘crack’ cocaine slid out of his pant leg and onto the ground. Officer Walsh arrested the defendant and transported him to the police station for booking. . . . During a more thorough search of the defendant at the police station, officers found additional evidence that was indicative of drug dealing.” (Emphasis supplied.)
The objective reasonableness of the patfrisk is the basis for the present *301affirmance. We do not reach the arguments capably presented by both the defendant and the Commonwealth upon the questions (1) whether the patffisk can constitute a search in anticipation of an immediate arrest based upon probable cause and exigent circumstances, and (2) whether the patfrisk can constitute a search incident to an imminent lawful arrest. See Grasso & McEvoy, Suppression Matters Under Massachusetts Law, §§ 14-1(a)-(c)(2); 12-2(a) (2012-2013 ed.).
The trial of the defendant occurred in January of 2010. The United States Supreme Court announced the McDonald decision (applying the guarantee of the Second Amendment to the States) on June 28, 2010. A criminal defendant would receive the benefit of a change of the law while, as here, his case was pending on direct review. See Griffith v. Kentucky, 479 U.S. 314, 320-328 (1987); Commonwealth v. Greineder, 458 Mass. 207, 237 (2010), judgment vacated on other grounds, 133 S. Ct. 55 (2012); and Powell, 459 Mass. at 587 (where the defendant’s trial occurred in January of 2009 before the delivery of the McDonald decision in June of 2010, the defendant’s failure to raise his Second Amendment claim at trial did not preclude his assertion of it on appeal). We therefore consider the defendant’s present Second Amendment contention.
At the street encounter the defendant told police that he was intending to get a license on the following day.