changeset 6328:4f626b53f908

reverse build breaking patch (CR#7179349) d6cba7bfbb3d
author mduigou
date Thu, 18 Oct 2012 13:02:45 -0700
parents cdc386032089
children b7ca97bb737b
files make/sun/osxapp/Makefile make/sun/osxapp/ToBin.java src/macosx/native/sun/osxapp/NSApplicationAWT.m src/macosx/native/sun/osxapp/resource/icons/JavaApp.icns
diffstat 4 files changed, 16 insertions(+), 102 deletions(-) [+]
line wrap: on
line diff
--- a/make/sun/osxapp/Makefile	Tue Oct 16 11:08:49 2012 -0700
+++ b/make/sun/osxapp/Makefile	Thu Oct 18 13:02:45 2012 -0700
@@ -28,11 +28,6 @@
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
 
-GEN_DIR=$(GENSRCDIR)/sun/osxapp
-ICON_DATA = $(GEN_DIR)/AWTIconData.h
-
-CLASSES_INIT += $(ICON_DATA)
-
 #
 # Files
 #
@@ -68,7 +63,6 @@
 	-framework QuartzCore
 
 CPPFLAGS += \
-        -I$(GEN_DIR) \
         $(call NativeSrcDirList,-I,/native/sun/osxapp)
 
 
@@ -76,34 +70,6 @@
   CPPFLAGS += -DINTERNAL_BUILD
 endif
 
-TEMPDIR_CLASSES = $(TEMPDIR)/classes
+clean clobber::
 
-$(TEMPDIR_CLASSES)/sun/osxapp/ToBin.class: ToBin.java
-	@$(prep-target)
-	$(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $<
-
-ifdef OPENJDK
-    ICONS_PATH_PREFIX=$(PLATFORM_SRC_MACOS)
-else
-    ICONS_PATH_PREFIX=$(CLOSED_SRC)/macosx
-endif
-
-generated.clean:
-	$(RM) -r $(GEN_DIR)/*.h
-
-ICONPATH=$(ICONS_PATH_PREFIX)/native/sun/osxapp/resource/icons
-ICON = $(ICONPATH)/JavaApp.icns
-
-$(GEN_DIR)/AWTIconData.h: $(TEMPDIR_CLASSES)/sun/osxapp/ToBin.class $(ICON) 
-	$(prep-target)
-	$(RM) $(ICON_DATA)
-	$(ECHO) "static unsigned char sAWTIconData[] = { " >> $(ICON_DATA);  \
-	$(CAT) $(ICON) | \
-	    $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) -Djava.awt.headless=true \
-	    sun.osxapp.ToBin >> $(ICON_DATA); \
-	$(ECHO) "};" >> $(ICON_DATA);
-
-
-clean clobber:: generated.clean
-
-.PHONY: generated.clean
+.PHONY:
--- a/make/sun/osxapp/ToBin.java	Tue Oct 16 11:08:49 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.osxapp;
-
-import java.io.*;
-
-public class ToBin {
-    public static void main(String[] args) throws Exception {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        int nRead;
-        byte[] data = new byte[4096];
-
-        while ((nRead = System.in.read(data, 0, data.length)) != -1) {
-            baos.write(data, 0, nRead);
-        }
-
-        baos.flush();
-
-        byte[] buf = baos.toByteArray();
-        for (int i = 0; i < buf.length; i++) {
-            System.out.print(String.format("0x%1$02X", buf[i]) + ", ");
-            if (i % 20 == 0) {
-                System.out.println();
-            }
-        }
-    }
-}
--- a/src/macosx/native/sun/osxapp/NSApplicationAWT.m	Tue Oct 16 11:08:49 2012 -0700
+++ b/src/macosx/native/sun/osxapp/NSApplicationAWT.m	Thu Oct 18 13:02:45 2012 -0700
@@ -31,7 +31,6 @@
 #import "PropertiesUtilities.h"
 #import "ThreadUtilities.h"
 #import "QueuingApplicationDelegate.h"
-#import "AWTIconData.h"
 
 
 static BOOL sUsingDefaultNIB = YES;
@@ -259,26 +258,25 @@
         theIconPath = [PropertiesUtilities javaSystemPropertyForKey:@"apple.awt.application.icon" withEnv:env];
     }
 
-    // Use the path specified to get the icon image
-    NSImage* iconImage = nil;
-    if (theIconPath != nil) {
-        iconImage = [[NSImage alloc] initWithContentsOfFile:theIconPath];
+    // If the icon file wasn't specified as an argument and we need to get an icon
+    // we'll use the generic java app icon.
+    NSString *defaultIconPath = [NSString stringWithFormat:@"%@%@", SHARED_FRAMEWORK_BUNDLE, @"/Resources/GenericApp.icns"];
+    if (theIconPath == nil) {
+        NSString* bundleIcon = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIconFile"];
+        if (bundleIcon == nil) {
+            theIconPath = defaultIconPath;
+        }
     } 
 
-    // If no icon file was specified or we failed to get the icon image
-    // and there is no bundle's icon, then use the default icon
+    // Set up the dock icon if we have an icon name.
+    if (theIconPath != nil) {
+        NSImage *iconImage = [[NSImage alloc] initWithContentsOfFile:theIconPath];
+
+        // If we failed for some reason fall back to the default icon.
     if (iconImage == nil) {
-        NSString* bundleIcon = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIconFile"];
-        if (bundleIcon == nil) {
-            NSData* iconData;
-            iconData = [[NSData alloc] initWithBytesNoCopy: sAWTIconData length: sizeof(sAWTIconData) freeWhenDone: NO];
-            iconImage = [[NSImage alloc] initWithData: iconData];
-            [iconData release];
-        }
+            iconImage = [[NSImage alloc] initWithContentsOfFile:defaultIconPath];
     }
 
-    // Set up the dock icon if we have an icon image.
-    if (iconImage != nil) {
         [NSApp setApplicationIconImage:iconImage];
         [iconImage release];
     }
Binary file src/macosx/native/sun/osxapp/resource/icons/JavaApp.icns has changed